Main: Refactor argument parsing
Allow undo from command-line
Main: Remove unused imports