Move variable definition code out of confparse.c, and refactor