remove use of Object.keys

This is something of a rewrite, but has the following improvements:

* More correct treatment of sparse arrays
* Can be used in browsers with Object.keys
* Can be used to _implement_ Object.keys
* Separates the implementations for each iterable thing for clarity/readability

This comes with some tradeoffs though:
* Tiny bit of code duplication
* Possibly slower due to the extra function call. If this is an issue
  each implementation could easily be inlined.