Update tokens.py to work with python 3. Needs at least Django 1.5 to work, which is noted in README.