Made pattern matching multithreaded using the BOOST thread library. Needs formatting and cleaning a bit more, but works.