Restore the middleware_classes as used in Django < 1.7

Django 1.7 removed most middleware classes from the default config
Use six.add_metaclass for the custom Model subclass