Don't cache hasOwnProperty.

It's a little confusing, JSHint complains, and it doesn't make a big
difference anyway.
Miscellaneous code cleanup.