Changed how database sessions are used.

Sessions are now created and closed individually each time the database is accessed, rather than having one session per room.

Because this is a massive backend refactor, it probably broke some things.
It's also quite messy, but according to SQLAlchemy, it's the "right" way of doing things...