Implementing configured discovery:

- removed some confusing log messages;
- let the webserver callback only handle POST messages and only read
  the message body if we can find a corresponding endpoint;
- in case the webserver cannot handle the message, let the default
  implementation take over and return a 404.
Implementing configured discovery:

- fixed the JSON encoding/decoding of the proxy and endpoint to
  conform to the service interface (single-valued responses should
  be returned, not an array);
- better error handling in the proxy when given unexpected responses;
- fixed some memory leaks.