Apart from manually registering classes, allow for domain-aware
factories to be plugged in
Added optional osgi solution