Refs #326: Optimize queries in registration and message log

- registration: use prefetch_related so each contact's connections
  are pre-fetched and we don't need one query for every contact on
  the screen
- messagelog: use select_related to include each message's contact,
  connection, and connection backend in the original query, so we
  don't query for them for every message on the screen

Branch: 326-optimize-queries
Merge pull request #326 from rapidsms/326-optimize-queries

Speed test with Django debug toolbar