Fix a python2.6 compatibility issue.  Removing a dict comprehension.

This commit sponsored by Christopher Beppler.  Thanks!
Use oauthlib's safe characters when generating client_key and client_secret
Tidy up federation code and add tests to cover more of the APIs
Raw image mediatype had a non-unicode logging call

Was causing UnicodeDecodeError when file/folder was not ascii.
Fixes bug #935.
Add __repr__ for Collection and CollectionItem
Add new hook 'collection_add_media'
Add new hook 'collection_remove_media'

Also clean up views.py and remove unused import 'send_comment_email'