Fixes migration issues and the seltest command

The migration fixes might conflict with Taylor's changes when we
get around to merging that. We should be sure to check ./manage.py
syncdb followed by ./manage.py migrate on a clean database to make
sure it works after the merge (which will likely be a manual one).