update middleware to use current django mechanism

Django-cooki18n's middleware mechanism was a bit outdated, which was causing some issues for us. This has resolved the issues and hopefully updates the mechanism to current dhango standards.