Allow for custom User model, with backwards compatibility

Take 2, this time we implement the change in a backwards compatible
manner to support django version < 1.5.