move ScopeNode into its own file