Make the add-on OSGi compatible

Adapt this to make the add-on OSGi compatible. Worker at least in Karaf.