cleaning up some old crufty stuff. adding some documentation. adding the switch command. breaking a bunch of stuff out into smaller pieces (helpers)