Adding support for custom user models (with fixes)

This PR incorporates the hard work done by @tanderegg, @ItsNotWorking and @stefanfoulis with a couple of last minute fixes of mine, as discussed in divio/django-cms#2622. Thanks so much for your effort.

Travis CI already passes for my local fork, see https://travis-ci.org/koirikivi/django-cms/builds/19692711.