Support Django 1.5 custom user models

Thanks to ondrowan, reinspijkerman, bmease, and lukashed for contributions.