made expandvars more dynamic
implemented recursive expansion of config-vars