added support for oid generation when encoding. Expanded testing