Improve NodeStoreTiming test

This allows sets of database inserts and fetches to be generated on the
fly in a repeatable fashion and adds more realistic tests.