DB tests are enabled for Travis and fixed to be passing

This is a summarizing PR for #261  #272  #273  #274 where you can find more detailed description of individual changes.