Move variable manipulation code out of confparse.c

There is some code in confparse.c for messing with arbitrary variables that ought to become general-purpose and go into lib/. This is a first step towards splitting config.c into reasonable pieces.