Get a value from an object using a keypath string