Add stateful parser class

Includes untested full code block parser