fix(errors): Export error types and make parsing more robust
tests(stanza): Add tests for stanza parsing

This adds a number of tests for the stanza functions. These tests
should be exhaustive.