Move getVariableName to static FreeVariableChecker.

Allow derived classes to use this helper function