Clean upp class inheritence issues.

These changes are meant to further enable subclassing of User. A subclass will now return the correct type on query operations like CustomUser.Query.get(**kwargs).

Could someone run the tests?