- Fix some threading issues, should (almost) always use a scoped session when using sqlalchemy with a web framework.
- Clean up a couple of bits of code by removing some unneeded statements.