Rounded off the tests for getFreeVars(). Caught one more bug this way.
Added unit tests for renameVarsToVars() and made them work.