Py3k support

This pull-request passes all the test except for `test_app.py`, under Python2.7 and Python3.3.

The reason is that `Flask` is not Py3k ready, but I think my modification should be harmless.