Minor tidying.
Initial work towards adding command line commands
Initial working version of cmdline