Reset context after withinElement

I know it’s an undocumented helper, but it would be helpful in my tests to reduce verbosity. It was mostly working, but not resetting the context after the `withinElement` callback completed. I added a test that verifies that an `expectElement` after a `withinElement` now works.

I could add it to the documentation if you think it’s ready to be public.