Parse arguments using getopts()

 * In order to better support short options (such as stacked short
   options -vc <arg>, we have moved to parsing the arguments via a
   slightly abused version of the getopts shell loop.  Effectively we
   shut down automatic error reporting by prefixing the optstring with
   ':', and then handle optional arguments and long-arguments in the
   error condition of getopts().

 * In order to facilitate the above changes the shlib.optarg() and
   shlib.getarg() interfaces now manipulate OPTIND.