Restructure PatternMatching API to use TextReader.

Instead of method overloads taking string or stream, all of
PatternMatching methods now take TextReader objects.