Move common argument parsing code into main() function in osimctrl