Update print statements to use the new function syntax.

In python 3, print is a function rather than a statement. This is helpfully
included in python 2.6+ with a __future__ import.

Several of our print statements existed inside management commands. The proper
way to output inside of a command is with self.stdout.write (or
self.stderr.write), so I've updated all of those.

Testing done: Ran unit tests
Reviewed at https://reviews.reviewboard.org/r/4904/
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/
Abstract away some types

String and integer types have changed in python 3. In 2.x, the 'str' type is a
string of bytes, and the 'unicode' type is a string of text. In 3.x, the
'bytes' type has replaced the old 'str', and 'str' has replaced 'unicode'. The
six library has abstractions for these that we can use while we're trying to
support both.

Additionally, 3.x has merged the 'int' and 'long' types, so there's a similar
abstraction for that.

There's still a lot of more complicated stuff to do with how we handle strings,
because of the changes to string literals. The stuff where we handle encoding
for diffs will require some special attention, I think.

Testing done: Ran unit tests.
Reviewed at https://reviews.reviewboard.org/r/4907/
Fix up another call to iteritems()

This just snuck in without me realizing it. At some point we may want to create
a 2to3 tool for reviewbot...
Fix a syntax error.

Change c316be6c4558bb3577478909881ee65f5430742f introduced a syntax error with
an extra comma. Trivial fix.