CMS-3787 Move jaxrs code into seperate bundle. Reworked some code.