Use forward-compatible python (part 1).

### Motivation
Since we are targeting Python 2.7+, we should start using syntax and features that are forward-compatible with Python 3. This PR incorporates some suggestions made by the [python-modernize](https://github.com/mitsuhiko/python-modernize) tool.

### Changelog 
* Use .items() instead of .iteritems().
* Use new octal notation (PEP 3127).

### Roadmap
There will possibly be subsequent PRs targeting:
* `import`s
* `print` statements