.sh_functions: Turned some old scripts into functions