Fix Tests

In brief:
* fix broken tests (e.g, PostgreSQL is used in SQLite tests);
* add missing tests;
* skip tests if the required backend (Mongo, Memcache) is not available
* allow one to skip tests for unavailable DB backends