Made error fields exported
Removed redundent identifiers
Removed rwcount and encoding/binary dependencies, adding conversion functions and size tests