Adds add_component function and its corresponding test