Clean up imports and interfaces

- Be consistent about simplejson over stdlib json
- Alphabetize some imports and group into "import" and "from" sections
  for additional readability.
- Hide the hem module IDBSession interface inside h.interfaces.
- Fix some linter warnings about unused imports
Don't hold database transactions on websockets

I decided to go with the fix where we manually manage the transaction.
I first attempted to disable pyramid_tm on websocket requests using a
tween but the problem is that sessions get opened implicitly anyway
when we call into our model code so we need to close the transaction
after all the websocket messages anyway. In that case, I decided it
was clearer to just leave pyramid_tm alone and manage the transaction
in the websocket session manager.

Fix #624