build: add back proper she-bang
build: update function names for better compatibility
build: remove function that isn't needed anymore
build: organize/alphabetize functions and optargs
build: remove left over code
build: remove duplication