Refactored error handling mechanisms for parsing.

- This is needed to make passing error handling devices into more pieces of the parser easy.

#210

/cc @pranavkm 
wow i'm silly, :+1: just gonna pass it in.