Integrate some library functions

I've been providing a fallback for when `Object.keys` is not defined, but I suspect it would only be a problem in IE8 or old versions of safari/firefox. Maybe we should use https://github.com/es-shims/es5-shim