Optimzations to iteration.

Iterating through keys is about 3x faster now.
Implement bulk insertion. Fixes #1