Adding more unit tests for various pieces that are being migrated to DBIC

Main code rev. 1866