Rewrote the command line parsing and have sanity checks