Don't use a DIY options parser. Use built-in POSIX-compliance parser.

Also started refactoring adaptation_switch.c to break out the layer 2
stuff.