Added support for incremental checking

This is in preparation for creating a lexer. Also split off the
functionality to see if a string matched from the stepping
functionality. Renamed the functions that take machines as arguments.