Cleaned up getopt

Getopt is provided as an alternative to unistd for windows support -
just needed a little bi of cleaning up since last time I used this code.