Refactored command line class and added tests