Merging numerous fixes for django 1.5's custom user models, as well as backwards-compatability fixes.