Sweep for pep8 problems and common python gotchas.

Some python gotchas:
- id is a builtin method-- it's generally preferred not to overwrite it in any scope
- Comparisons with against booleans and None should use `is` instead of ==
- Default arguments should not be mutable, since they are defined at the methods define time.
- Naked exception catching is generally considered bad practice. I didn't fix all of these because I didn't want to risk breakages without unit tests.

Otherwise I made a sweep for formatting to match pep8 conventions. Read more about python formatting conventions here: https://www.python.org/dev/peps/pep-0008
I agree that clobbering the `id` function is a bad idea, but I'm not sure I agree with adding an underscore to this variable is correct. Convention says that underscore is private, which this is not. I'd maybe go with `identifier` or something similar.