Additional work to getopt.c

It isn't useable yet
WIP