Complete rewrite using cherrypy