Options are handled in GNU style fashion, non-option arguments can be intermixed with options (see gnu_getopt).

Code cleanup.