Removed many unnecessary uses of dict.keys

This has a few advantages: some of these locations will perform
slightly faster, it's minutely less code, and dict.keys has a different
behavior on Python 3. Also removes usage of dict.iterkeys, which is
identical to just iterating over the dict, except it doesn't exist on
Python 3 at all.

Change-Id: Ia91e97232dc8d78cf63fa807de288fc25cf5425d
Supply correct arguments to __init__ of a base class

Hopefuly this extra test case is not too inane and slows us
down for nothing. It is verified to fail with the old code.

Change-Id: I604eca09f7f9ae044a8ad75284cd82a37325f99c
Merge "Removed many unnecessary uses of dict.keys"
Merge "Supply correct arguments to __init__ of a base class"