add lots of test helpers + tests for the database reader, as well as som...

...e changes to the db reader