refactoring to prep for analysis work

Some misc refactoring in preparation for analyzer work:

- added a `ServiceException` class
- formatting nits
- `Services` now store their id in a final field
- `ServiceImpls` store their id in a final field
- `ServiceImpls` can optionally register their request handlers in a map, from actionId to the handling function

@umop