Added CommandExecutor and LogHandler, cleaned up code.