Move the null terminator while trimming.
Implementing configured discovery:

- fixed a couple of problems in the endpoint poller;
- make sure that each published service gets an endpoint ID;
- implemented the server for published services, allowing other
  RSAs to query the exported services.
Added TODO about the endpoint ID.