Case migration

Support for migrating usernames and emails to lowercase.

This includes:
 - code that can be deployed on an existing instance (with an existing database) without user impact.
 - a script to help migrate the contents of the database