Real test against actual database
Smarter testing and backend code

Use application environment to get the database settings, and the
unit test modifies the environment for testing purposes.

Logging is now sent to a file during unit testing, to keep the tty
output clean when running the tests.

make test passes