SERVER-15210 SERVER-15211 remove OID undefined behavior and make it endian aware

Closes #784

Signed-off-by: Benety Goh <benety@mongodb.com>