Produce HTML or JSON based on accept header.

Also:
- pass settings from config file to adapters (caution: method signature for
  adapter methods has changed!)
- add some log statements here and there (temporarily, to see what's going on)
- respond with 406 if no suitable accept header is sent by client
- respond with 500 for any other error