simplify getopt handling

Also gets rid of those 'odd number in hash assignment' warnings.