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 .
This is a useful update, but isn't needed for the Flask change; it would be better to revert this for now.