replace_vars(): completed implementation of depth replace
added test for replace_vars to test var in var replace