Refactor code for parens and quotation checking.

I really wish monodevelop didn't mess up indents.