Rename variables related to flags. Generate documentation.