Refactor the repl command methods into Command classes.