improved handling of inherited and non-enumerable object properties

This is exactly the same set of changes as #78, but targeting the `develop/next` branch. See #78 for more details.

Hope this takes care of everything you need to get this merged!