Make gadget_dir_read a generic, to use type checking
Insert components if they already exist