Fixed #3840: Removed in/hasOwnProperty usage in engine

Replaced with `obj[key] !== undefined` or `obj[key]`, more compact, faster and easy to read.