Make the add-on OSGi compatible

Adapt this to make the add-on OSGi compatible. Seems to work in Karaf