Switch to defineProperty; set enumerable flags properly

__defineGetter and company are deprecated; this switches completely to defineProperty, and uses the enumerable flag to fix #722.

I've tested in Firefox, Chrome, and Safari.  It still needs testing in IE and mobile browsers.