Fix type issue in removeComponent.
Allow getComponent to also return subcomponents.
Add unit tests.