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
Separate try-catch blocks for sessions

When going through all the sessions for checking if that annotation fits for their filters,
now the sessions have their own try-catch block, so if an exception arises in a session it will not affect other sessions.

Keeping the original try-catch block for the whole after_action() to, because an annotation with false document data could still
cause an exception before the session-loop starts, and we don't want any after_action() fail to affect any previous annotation activity (save, update, delete)
Add "detail-mode" to page_search template

Before this the quote of an annotation was missing from the search page.
Now it has been working similarly as the viewer page.
Whitespace correction for page_search.html
Page search now can search for quotes too.

- Only searches for quote in the top-level annotations
- Also if another search term is given it will only match for top-level annotations
- Quote hits are displayed in detail mode
Always hide the adder button when activating Highlighting Mode

Fixes #625
Highlight quote hits for page_search

The quote search terms are now highlighted in the annotations quote.
Hovering above an annotation card highlights its quote for search results too.

Not it has the same behaviour as the Viewer in this fascion.
Add protection agains reloading annotation twice in some state transitions

Work around situations when two simultenous parameter change caused two subsequent reloads.

The two cases were:
 * When forcd login is triggered by enabling Highligting Mode without loggin in first
 * Then logging off from Highlighting Mode (which also switches off highlighting mode)

Fixes #626
Merge pull request #627 from hypothesis/617-search-oddities

Fixed some page search issues. (See #617 for details.)
Fix default Vagrant config using precise32, include build-essential.
Merge pull request #636 from gnott/develop

Fix default Vagrant config using precise32, include build-essential.
[Chrome] enable page action on all tabs at install

Closes #460
pip --use-mirrors in bootstrap script

Hopefully, this is enough to close #630.
Use a directory-local pip download cache

It's not very nice to drop a bunch of tarballs, potentially not small,
into a hidden directory in a user's home folder. Instead, let's honor
the environment variable, PIP_DOWNLOAD_CACHE, if it exists, but if it
does not we shall use a local directory. At least this way, if the
user decides to delete the repository, she will have removed all the
downloaded packages as well and we will not have left cruft on her
machine.
Bugfix for SearchController.refresh for highlight-only annotations

It broke when the annotation.text field was empty
Bugfix for on_message(): separate try-catch for each annotation for past data

Before this, if there was even one error when trying to update annotation data, when loading back past annotations via stream, we whole stream got broken.
Now each annotation was its own try-catch block and the problematic annotations do not get published.
Fixes #633
When making a Highlight in HL mode, switch sidebar view

... to single view, showing only the newly created highlight.

(First attempt to fix #461.)
Merge pull request #645 from hypothesis/641-hl-mode-change-view

When making a Highlight in HL mode, switch sidebar view to single mode.

Fixes #641.