Simplified add_component and remove_component.

DRY up component adding and removal with correct hash initializer and extraction of key_name.