Trim whitespace from commands, and some minor ConfigManager improvements