CMS-3588 Refactor JaxRs for easy OSGi migration.