refactor script, reduce path reqs to just subdir
extract parseOptions, util.defaults