Modifying the db and queue libs to make unit testing easier.

Mainly they don't auto-connect anymore.
Starting to add tests for the challenge route.