added a Scopes.UNDEFINED and tweaked the scoping and metadata pieces to be a little more intuitive, configurable, and speedy