use single-line output versions of cmd and shell

fixes username ending in newline
refactor determinePkgBranch into parseArgs