Support for Django 1.6 + some cleanup