Update to work with latest tornado

Also, apply format for pep8