Cloned from flask-dev; working Tornado app with Flask, WebSockets, and writes to db