Make database URL for unit testing be configurable
Fix some major errors of unit tests with PostgreSQL
Make functional testing database configurable