CMS-3423 Convert wem-api to osgi module. Applied changes from my local branch.