Script for running pyflakes and pep8

Adding an executable run_tests.py which runs pyflakes and pep8. If we add unit
tests in the future then this is a natural place to run those as well. Static
checks do not presently pass.

This is largely copied from arm's test runner, which in turn was based on
stem's. I'm getting more and more tempted for stem to vend this functionality,
but that's not really appropriate...
Fixing all pep8 and pyflakes issues

Getting our static checks to pass. Python uses an underscore convention for
everything except classes (my_method rather than myMethod) which isn't yet
corrected but pep8 doesn't catch that for some reason.
Settling on four space indents

Exitmap uses four space indentations, which is actually the PEP8
recommendation. Removing E111 from our style blacklist and changing
run_tests.py to match the rest of the project.
Using four space hanging indents

Another bit of PEP8 that I don't personally follow, but we might as well here
since exitmap uses four space indents. Removing issue E121 from the blacklist
and fixing occurances.
Removing spaces from around keywords and variables

Yet another bit of PEP8 that exitmap follows but I don't. Removing E251 from
the blacklist and fixing the occurances.
Renaming variables and functions to the underscore convention

Python's conventions are to use camelcase for classes (MyClass) but underscore
for everything else (my_function() and my_variable). Actually, just a little
while ago I spent over a week fixing this for arm (I was originally a java
developer, so camelcase was an old habbit). Thankfully exitmap is a *lot*
smaller.

Did bulk renaming with...

  grep -ilr 'oldName' ./* | xargs -i@ sed -i 's/oldName/new_name/g' @
Static tests and shifting to PEP8 conventions

Adding a run_tests.py executable that runs pyflakes and pep8 checks on our
project. Also shifting exitmap's conventions to be PEP8 compliant.

None of these changes should have a functional impact, and indeed a quick
sanity test of exitmap still works.
Authenticate to tor via cookie auth

No reason not to include authentication. Stem can transparently handle anything
except for password authentication.
Simplifying exitselector conditionals

It's been too long since my CS courses. This conditionals made my head hurt...

  not ((address and address in desc.address) or (not address))

... is equal to...

  (not (address and address in desc.address)) and address

... which in turn is equal to...

  (not address or address not in desc.address) and address

The initial 'not address' is obviously pointless so this can finally be
distilled to the far more intuitive...

  address and address not in desc.address

The desc.address is a string. There's no reason to do substring comparison here
so swapping to equality...

  address and address != desc.address

I was tempted to just jump to that since it was clearly what the code was going
for, but that initial consitional was so weird I wanted to prove to myself it
was the same. :)
Running queue_reader in a daemon thread

There's no reason for this to be a non-daemon thread. Especially since we
aren't joining on it for shutdown.
Rewriting get_exits()

This function is essentially doing a series of filters so simply opting for
that instead. The only functional change is that we now only do the
can_exit_to() filter if we have some hosts. From my read the prior code would
reject everything instead which I suspect was a bug.
Prompting tester to install pyflakes or pep8 if unavailailable

On reflection we shouldn't just silently pass if pyflakes and pep8 are
unavailable. We should notify the user that we didn't do anything instead.
Invoking subcommands via a daemon thread

Another thread without the daemon flag set. Also some minor non-functional
tweaks.