Add ExitPolicy, ExitPolicyIterator from arm/torTools
Overhaul exit_policy.py

- Fix Indentation issues
- Remove ExitPolicyIterator class
- Add ExitPolicyLine class
  - This class represent a single line from the Exit Policy.
    (provides much better abstraction IMHO)
  - __init__(), __str__(), and check() are copied from ExitPolicy
- Changes in ExitPolicy -
  - Now, it acts a wrapper class to ExitPolicyLine
  - It contains a list ExitPolicy._policies which stores all the policies
    and each item in _policies is an object of ExitPolicyLine
  - check(), isExitingAllowed(), __str__(), and __iter__() are
    changed to provide a wrapper of sorts for ExitPolicyLine
  - add() is now used to add an exit policy line - This creates
    an object of ExitPolicyLine and adds it to ExitPolicy._policies
Parse "private" alias better
Add doc and fix whitespace
Add ExitPolicy.get_summary()

This provides a summary description of the policy chain
similar to the consensus.
Add MicrodescriptorExitPolicy

This class has four methods -
add() - which is the public method that the user calls to add
exit rules or policy. If a policy is added, then this instance
can't be changed further. Rules can be added till we we get a
wildcard('*') as a rule.
add_rule() - parses the rule
add_policy() - parses the policy
__str__() - creates a string representation of the policy
Make stem.util.connection.is_valid_port accept a list

Iterate through the list and check if each item is a valid
port or not.
Remove MicrodescriptorExitPolicy, add validation and exception

The micro desc exit policy is currently useless until we figure
out what it's used for.

Validate all the ip address and ports. Raise exception if wrong
Add unit test for exit_policy

Test the validation and parsing of the exit policy
Add exit policy test to run_tests
Add microdescriptor exit policy

The microdescriptor policy class can now parse
exit policy summaries. Add tests for this
Utilities for IPv4 and IPv6 addresses

Adding the utilities that I need for the ExitPolicy to handle and translate
addresses and their masks. Pity that these aren't provided by the python
builtins. The IPy package seems to do it but this isn't worth adding a new
dependency.
ExitPolicyRule class

Adding a class that conforms with the dir-spec's exitpattern entity. Plus lots
'o unit tests that told me over and over and over again that I was being
stupid. Hopefully this version is at least kinda sorta close to being right...
Removing ExitPolicyLine and ExitPolicyError

The ExitPolicyRule is a drop-in replacement for ExitPolicyLine, and there's
little reason to introduce a custom ExitPolicyError exception when a ValueError
effectively describes its use cases.
Splitting up ExitPolicyRule parsing

The ExitPolicyRule constructor was unpleasantly huge (and by extension, hard to
read). Moving most of it to helper funcitons for parsing the addrspec and
portspec.
Revised ExitPolicy class

Revising the ExitPolicy class to something resembling its final incarnation.
Next gonna revise the tests (they pass, but could use some love).
Test for the ExitPolicy's constructor

Test to make sure that we can handle both string and ExitPolicy lists. This
also checks that we can easily handle the split() output when breaking up a
csv.

Added __eq__() methods for the ExitPolicy and ExitPolicyRule to make policy
comparisons easier.
Correcting and expanding summary() example

The ExitPolicy class no longer has a from_str() function. Also adding an
example that better exemplifies how ranges work.
Adding a test for pydoc header examples

Little test for our pydoc example, and fixing a couple little bugs. There's a
larger bug due to our naive summary() implementation though a better solution
isn't immediately coming to mind.
Test for the set_default_allowed() method