Update to use cowboy middleware and cowboy router

Follow the new env tuple standard for cowboy middleware
Fix #62