Fixed database connection bug

- Connect to database before each request instead of maintaining an
  open connection
- Store connection in g object, which is available in the request
  context
- Updated functions to use g.db instead of taking a connection object
Merge branch 'database_fix' of ssh://github.com/RuddockHouse/RuddockWebsite into hassle

Conflicts:
	RuddockWebsite.py