Use Cross-browser hasOwnProperty

The `isEmpty` function sometimes breaks in IE8 because `hasOwnProperty` is not available on `window`. This fixes that.