Add cowboy and plug to dependencies
Add cowboy and clean up some code