Major refactoring, tests and Django 2.0 support
Much more internal details are tested now, thus we can guarantee more consistent output for different django versions and track changes in django easier. Code have been split into several modules with isolation of responsibilities.