Add support for id-resolution.

Needs tests.
Added documentation