I changed the way we use long options.

The old way, using indices in the option table, was very error prone, especially if options were added on different branches. Now we use integer constants > 255 to distinguish them.

This change might potentially break the windows getopt implementation, so please test it @MrHen