Add transform pattern concept.

If a pattern has a `transform` method it is invoked at the start
of a scan.