Reworked KSPManager.
Extracted the registry functions to their own interface. Added tests.