Changed options to support glx as well as egl. Added printing of
usage message on --usage.
Added --version option.
Added comments to all functions.
Fixed erraneous removal of --optind in parse_generic_options().