Allow responses with no return

To make chunked reponses work correctly the request does not rely on
cowboy_handler:resp, but still allow for clean shutdown
cleanup var names and avoid compiler warnings
Add option for custom marshalling handlers

Allow the use of custom functions for marshalling content
Fix case of accept header
Add warning for failed serialization
remove debug
Convert new encoder definition into content-type tuple for oldschool mimes
Add Content-Type header to respons
Default to json