Refactor WebAgg so it's easier to embed in other applications and run
over a server other than tornado.