Refactor Werkzeug requirement into flask

This is a PR for discussion is a rewrite of the code base that removes Werkzeug and replaces the server code with a Flask implementation - see issue #38 .
These aren't part of the flask update.