Added asData() and toJSON() to error objects. Closes #20