Refactoring
Added command line parsing and unittests