Initial. Basic getopt setup.
Implements functions.
Removes trailing whitespace.