Use control.Exception for MatchFailedException

The control.Exception helpers are intended for flow control exceptions
like MatchFailedException. It makes me feel slightly less guiltly about
using exceptions for flow control and cleans up the code a bit.
Add unit test for ScopedSyntaxTree

This didn't catch any errors but it should've been there since the
beginning