Added support for OSGi and ServiceLoader.