Add tests of output and reference databases

There is a problem with db_comparator function. It is giving false positive for test cases, but when used separately, it shows the differences of compared databases. 
I think I might be messing with yield statements in my tests, so I need some help to resolve this.
Thanks.