This allows to build local histories to be matched against the ones returned by the bank; in particular, this version builds those stories regardless of /history or /history-range being run.
Implementing the "lib" and "testing-lib" functions to use it.