Minor cleanup suggested by Eclipse PyDev code analysis

There's also a ton of unused import and unused variable warnings:
https://gist.github.com/cdeil/5305127

More than half of those are real (like all the `import sys` statements in modules that don't use `sys`), if you think it's worth cleaning up let me know and I'll do it.