Big revamp - upgrade for current SDK, preparing to use it in mongo_dart and objectory