A little more refactoring to get dosgi support working properly.
Some more fixes and enhancements to keep stabilizing the tests.
All but the Dosgi integration test should be failing now.