idHandler service

Extracts id handling to an own service.

This is the start of a series of future PRs that will deal with extracting simple common functionality out to individual services.

Id logic was pretty much hardcoded in several spots before. A more complex solution for id handling in general will be needed soon - this service will help us to work on it.