The first draft of converting to OSGi version. Test functionality to be restored later