Modified MarkovChain.__contains and its test to use sequence search.