Adds a stopParsing method

Adds a stopParsing method and tests to support it