Added support for CLI options to be passed directly into program.
Did some tidying up. More to be done soon.