Moved command line code in a seperate class and tested it

Same as title.