#447 Simplify encoding methods per code review

Simplify encoding methods by not passing an error around and just setting the _error ivar.