Pylint fixes

Random style guide compliance fixes to pacify pylint. Mostly indentation corrections, line length enforcement, and avoiding masking variables from an outer scope. 

I tried to not go on too much of a rampage before submitting a pull request. Please let me know if this PR is at the wrong level of granularity, i.e. if you would rather that any future Pylint fix PRs contain more or fewer fixes.