Refactored webserver and prepared for Heroku