Improved AttemptLog filter (for efficiency and correctness)

1. In practice mode, include AttemptLogs both with `context_type='playlist'` and `context_type='exercise'` (rather than just the ones from the current context_type).
2. Add an index_together on the fields typically queried together, for a 20x speedup. 
The middleware below (which is only added when debug toolbar is enabled) allows json api requests to be profiled and inspected using the toolbar.