WIP: more seamless getopt support

TODO:
 - verify
 - unit tests
 - add support for subcmd + getopt

Current status: subcmds are mos def broken.