IE9 support

Replaced __define[G|S]etter__ with Object.defineProperty.
Replaced String.trimRight with String.replace(/\s+$/,"") because trimRight
is not ECMAScript5 function and IE does not support it.