Make middleware changes work on python 3.3.3
Merge Mystor's fix for the limiter for python3
Merge Mystor's py3 fixes