moved import to beginning of file, as it's requested for the inheritance, and
was breaking a autodoc by sphinx.
Minor other corrections for pep8 compliancy
alternative to handle middleware inheriting from crm or not
Merge pull request #3 from Fandekasp/master

Middleware.py fix