Moves the database connection to the app context
Adds connection close method and fixes tests
Merge pull request #67 from lukecampbell/db

Moves the database connection to the app context