Implemented internal counting versions of writeWord and added writeByte