First shot at implementing getopt.

Not terribly Perlish ATM, but it's a start.