added a minimal getopt interface and defined a few new types