Huge Performance Improvements

### Largest change

Enable the identity map for Mongoid. This allows subsequent finds for
the same object to skip the DB and use an in-memory store of all
retrieved records.

In many cases this reduces the number of DB queries from _hundreds_ to a
few tens.

This is particularly noticable when showing lists of problems.
Previously each `problem.app` reference caused a `App.find()` using
the `app_id`, now it's an in-memory lookup.

### Other changes
* Restore faster `app.==()` method from Mongoid
* Use a predefined scope in one place.

Should largely fix #432