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.
Fixes transitions between connection types.

Votes from external peers will influence our WAN address and our
connection type.  New unit tests are included to test Dispersy making
the correct assessment, event when votes change over time.

The code has been simplified, as the previous code was unable to
correctly change connection type.  Also, updating the LAN address was
introduced.
Merge pull request #107 from boudewijn-tribler/lan-address-changes

Fixes transitions between connection types.
Merge pull request #110 from Tribler/next

Next
Reduce pylint warnings.
Merge pull request #111 from boudewijn-tribler/bugfixes

Reduce pylint warnings.
Removed Constructor class.

BloomFilter remains the same, but figures its parameters out by
itself.  This simplifies the code and allows pylint to work correctly.
Disable incorrect pylint warnings.
Replaces .get_bits_checked() with .bits_checked.
Removed old debug code from crypto.py

Long ago we did experiments with crypto disabled (by hardcoding 'if
True' into crypto.py).  To my knowledge this has not been used since,
hence this hack has been removed.
sha1 was no longer used.
Merge pull request #113 from boudewijn-tribler/crypto-cleanup

Removed old debug code from crypto.py
missing-identity performance improvement.

Handling missing-identity messages was using an expensive sql query.
This has been replaced with two simple queries resulting in a
considerable performance improvement (all exising indexes can now be
properly used by sqlite).
New unittest and some cleanup.
Using Python's abc to handle abstract methods and properties.

Since Python 2.6 the abc module provides a way to define abstract
methods and properties.  Before this the convention was to raise a
NotImplementedError.

Using abc will ensure an error is given when an object is instantiated
instead of waiting for the abstract method/property to be called.
Merge pull request #115 from boudewijn-tribler/bugfixes

Using Python's abc to handle abstract methods and properties.
Merge pull request #114 from boudewijn-tribler/performance

missing-identity performance improvement.
Merge pull request #112 from boudewijn-tribler/bloomfilter-cleanup

Removed Constructor class.