restructure as rack app for ease of hosting on heroku