Fix up issues with map usage.

In python 3, the map function has changed a little bit. In particular, it now
stops iteration when the first iterator it encounters is exhausted. This means
in cases where we were applying the identity function (using "None" as the
first argument), it would have different behavior. I've changed it to use
itertools.izip_longest (which in python 3 will just be called zip_longest).

There were also a couple places where the 2to3 tool suggested we replace the
map with a for loop. I've done so, since it seemed to make sense.

Testing done: Ran unit tests
Reviewed at https://reviews.reviewboard.org/r/4905/