A number of improvements/enhancements
Added testdb.cpp to support make check