RequestCache cleanup.

- Identifiers are now unicode strings, these are used as keys in the
  RequestCache instance and as Callback id's.

- Cache now takes a unicode string as a parameter, this is the
  identifier.  Older code set the identifier (outside of the Cache
  constructor) once the cache was added to the RequestCache.

- NumberCache is used when, instead of a predefined unicode string,
  the identifier must contain a random number.  This is used by, for
  instance, the introduction-request message.  The random number is
  available from the 'Cache.number' property, while the
  'Cache.identifier' property contains still contains the unicode
  string.

  Note that this means that any older code that used to encode
  Cache.identifier into a request or response message must now use
  Cache.number instead.

- The static method Cache.create_identifier is used to generate a
  Cache specific unicode string.  Parameters can be supplied to add
  unique features, such as the number in NumberCache.

  Note that the generic method 'handle_missing_messages' needs to get
  the identifier from a message instance.  This is done using
  Cache.create_identifier_from_message, which in turn should call
  Cache.create_identifier with the appropriate parameters obtained
  from the message instance.  Code that uses 'handle_missing_messages'
  must ensure their Cache object supplies
  'create_identifier_from_message'

- RequestCache.add(CACHE) replaces RequestCache.set(ID, CACHE).
  RequestCache.add will return None when CACHE.identifier is already
  in use.

- RequestCache.claim no longer exists.  A valid (read unused)
  identifier can be found using RequestCache.had or repeated calls to
  RequestCache.add, while checking its return value.

- RequestCache.{replace, has, get} have had their parameters modified
  to reflect the introduction of the unicode string identifier.
Removes print from unittest.
Unittests for RequestCache.
Clarify warning message.
Endpoint returns False when thread still alive.
Clarify asserts.
LAN/WAN detection cleanup.

- Dispersy._local_interfaces contains a list with all available
  interfaces, including their subnet mask

- Votes for our WAN address that originate from within our LAN are
  ignored.  A vote originates from within our LAN when the origin
  sock_addr matches any of Dispersy._local_interfaces, taking into
  account the subnet mask of each interface.

- Dispersy.estimate_lan_and_wan_addresses has been simplified.  It now
  recognises the inability to determine the WAN address of someone who
  is on its LAN address (or the LAN address of someone who is on its WAN
  address).

- Candidate.lan_address and Candidate.wan_address is now allowed to
  be (0.0.0.0, 0).  Previously the value would always be set to -some-
  address, sometimes resulting in incorrect addresses.

- Candidate.sock_addr is always used when sending packets to a
  Candidate.  The Candidate.get_destination_address method is
  deprecated.
WAN/LAN specific unit tests.
Minor comment and debug output changes.
Write summary file after test.
Callback identifiers should be unicode strings.
Obtain (possibly) new interfaces when reassessing.
Additional unit test code.
Do not introduce incomplete candidates.

Since we are only able to assess either the LAN or the WAN address of a
candidate, it is possible that the other address remains 0.0.0.0:0 (if
that is what the candidate reported).  These candidates should not
introduced
A Candidate.wan_address may overlap with ours.

it is possible that the WAN address that someone claims to have is
correct, while the WAN address that we believe we have is not.  it is
not a problem to have candidates with the same WAN address as us.
Add IP and connection type info to logger.
Code cleanup.
Merge remote-tracking branch 'remotes/upstream/devel' into request-cache
More asserts.
Merge remote-tracking branch 'remotes/upstream/devel' into WAN-LAN-fixes