[bug 896961] Small refactor for two global.js unit tests

Updates two if the initial global.js unit tests, removing the need for `__defineGetter__` (doesn't play nice with some Webkit versions, e.g. phantomJS).

Required a small change to the two corresponding global.js methods to make testing easier.