A little library for resource scopes.  This is the magic part.