Allow guards access to current scope

Guards don't have access to the local scope, just the pattern and the top-level environment. This change fixes that and includes access to the local scope. Tests are included to verify the fix and to make sure the change doesn't break scoping rules and allow pattern variables to leak to the outside scope.