Various tweaks to be pylint-clean

None of this should have any effect on functionality, except maybe in
the case of handling errors better in a few places. Most of this is:

- wrapping some of the particularly long lines
- renaming things that shadowed builtins or variables from a higher
  scope,
- simplifying loops originally written with enumerate(),
- prefixing _ to some variable names which are unused but expected to be
  unused,
- moving docstrings to the tops of their various modules/classes/
  functions so that they are treated as docstrings by Python, and
- changing some methods to staticmethods, classmethods, or plain
  functions where feasible

Adds a "pylint-project.sh" script that runs pylint on everything
in the project, excluding third-party code. Could be added to a git
commit hook if desired.
Merge remote-tracking branch 'thepaul/pylint-clean'