Added support for checking that all node vars are assigned once and that
node expressions do not refer to external definitions.
Fixed some validation errors; now properly accounts for node and function
scopes.