Make VarNode::type() not fail for function refs.
Make various set...() methods work with parent scope.