Lots of cleanups and restructuring to pave way for Django 1.6/1.7