Rewrote pattern replacement code
Rewrote pattern replacement code

Now much less hacky; can handle arbitrary length files.

funginstitute/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor,funginstitute/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor