Merge pull request #222 from csmith/master

Move some logic into parser factory.
Add events for certificate problems.

Issue #213