Make the add-on OSGi compatible

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