Refactored ObjectId and added tests.