Rewrote the CLI parser  to be oblivious to semantics. Also moved code into cli namespace