DATAREST-292 - Fixed application of configured base URI.

Major overhaul of mapping detection in RepositoryRestHandlerMapping. We now correctly map URIs if a base URI is configured via RepositoryRestConfiguration.

Additional tweaks needed for the back-port.