If PATH is not found anywhere, set it to a reasonable default
Clean up and add some comments
Change program commandline parameters names to be more general (not reference socat)
Create new templates directory to hold templates and file varnames which lists what the {variables in brackets} will be replaced with