Add Makefile and improve reusability of component

See commits for a more detailed summary of changes.