Refactor the config parser's AST.

Refs #5846