Cleaned up and documented the command module.