Well, there's a lot of stuff in there that is already solved differently in the nine branch, and it doesn't merge at all cleanly.  I cherry-picked ebf50c422f34d41be6eb192f22876ce7a0fd1af1 and applied the SREPattern fix manually.