Fix the context when iterating through dictionaries
- Use item values instead of keys as local context. It's un-Pythonic, but in line with the JavaScript implementation
- Use items for iterating through dictionaries and enumerate when iterating through other iterables