Removed the use of Object.keys and .filter to allow use in < IE9

As this file is loaded into the browser, it must not contain any ES5-only methods/functionality. It's still very common to need tests for IE 8 & 7 and this code is currently causing an error in those.