Refactor subsequence matcher to not use recursion and support multithreading. Also add a python implementation for easy experimentation with the algorithm.