Cli: Fix overwriting api.conf; Move black/whitelist functionality into AgentUtility class

refs #7253
fixes #7481