Added object.IsObject(), and turned WalkFn into a closure to pass in session struct.