SERVER-15210 SERVER-15211 remove OID undefined behavior and make it endi...

...an aware

https://jira.mongodb.org/browse/SERVER-15210
https://jira.mongodb.org/browse/SERVER-15211