Prerequisite changes in GUIDMixin and KBucket.

* Add and test hashing in GUIDMixin; a GUIDMixin can now be used
  as a key in a dictionary.
* Add and test iterator interface in KBucket.
* Add GUIDMixin support in keyInRange.
* Drop default value for market_id and relevant test.
* Test KBucket.addContact upgrades basestrings to GUIDMixins.
* Follow python naming conventions.
General maintainance.

* Update docstrings and function signatures.
* Follow python naming conventions as much as possible.
* Be consistent in the argument names.
* Require all methods to accept GUIDMixin as ID.
* Drop unused TimeoutError class.
* Purge exec flag from routingtable.py.
Setup initial testsuite; refactor abstract methods.

* Make abstract methods raise NotImplementedError; test most of them.
* Add initialization tests for abstract class.
* Follow python naming conventions.
Test and refactor initialization of RoutingTable implementations.

* Initialize superclasses properly.
* Use `super` instead of naming the superclass explicitly.
* Defer testing of other methods for now.
* Follow python naming conventions.
* Delegate logger instantiation to superclass.
Fix and abstract ID range. Test init attributes.

* Install an ad-hoc equality for KBuckets.
* Follow python naming convention.
Test and refactor kbucketIndex.

* Handle GUIDMixin transparently.
* Raise KeyError on key with bad range.
* Raise RuntimeError if kbucket invariant is violated.
* Include a hint for a possible optimization.
* Follow python naming conventions.
Test and refactor getContact.

* Handle GUIDMixin transparently.
* Ignore the docstring mentioning ValueError and
  test for a None value on unsuccessful lookup, as
  is the case throughout the code.
* Align signature with kbucket.GetContact and simplify code.
* Follow python naming convention.
Test and refactor removeContact(s).

* Make argument names consistent with rest of tested code.
* Leverage exceptions to simplify code structure.
* Add logging on exception.
* Follow python naming convention.
Test and refactor RoutingTable.distance.

* Raise ValueError if strings have unequal lengths.
* Handle guid.GUIDMixins transparently.
* Follow python naming conventions.
Test and refactor touchKBucket.

* Add ability to set timestamp manually.
* Test the abstract method, too.
Expand and test constant names.

* Purge exec flag from constants.py
* Define the maximum number of contacts per replacement cache.
* Define HEX_NODE_LEN_ID as the length of a node ID in hex.
Refactor node ID processing.

* Add and test numToId for easy conversions.
* Refactor _randomIDInBucketRange to use numToId.
* Refactor distance to use node ID length, and raise
  an exception when either of the keys is of improper
  length.
Test and refactor getRefreshList.

* Be deterministic; do not use randomized IDs.
* Drop _randomIDInBucketRange as it is no longer used.
* Use a list comprehension for simplicity.
* Avoid invoking time.time() many times. :P
* Optimization: do not enter loop if force flag is set.
* Drop unused import.
Drop addContact from TreeRoutingTable.

* Its proper implementation is contested.
* It references undefined names ("addErrback").
* The class itself is nowhere used in the code.
* It is very difficult to test, as it entails the network.
Merge pull request #730 from Renelvon/refactor_routingtable

Refactoring and unit testing of routingtable (part 1).
notaries is a list not a dictionary
Merge pull request #778 from yagoulas/get_notaries_bugfix

notaries is a list not a dictionary
Start of unified 'openbazaar [options] <command>' python based launcher script.

 - added pystun as a pip requirement
 - Gets external IP (UDP: port) using STUN servers.
 - Checks if DYLD_LIBRARY_PATH has been set on MacOSX, if not
   gives a warning and tries to ammend by manually loading
   libssl.dylib and libcrypto.dylib if found at `brew --prefix openssl`.
 - default configuration values loaded into a dictionary that will
   be used on the rest of the launching script.
 - OpenBazaar is launched and P2P port used is dynamic and based on the port reported as available via STUN.
   however, I'll try to use multiprocessing so that the code runs on a separate process
   and we can return control back to the user on the terminal's process.

 STILL TO BE DONE:
   - implementing shutdown websocket or http handler, and being able to send a websocket request.
   - implementing a status websocket or http handler to print the status of the servent

Important refactors, introducing OpenBazaarContext to carry runtime configuration options. [WIP - still very unstable]

  - ioloop.install() redundancy cleanup, only installed once on openbazaar_daemon.

  - refactored ioloop's instantiation and startup out of openbazaar_daemon.start_node()
     as a new method 'start_ioloop()', invoked at the beginning of start_node() inside its
     own daemon thread.

  - New OpenBazaarContext object to hold all runtime configuration parameters and more
    runtime related information.

  - Argument parser now uses default values defined in getDefaults(),
    no need for repetition of these defaults, now can be maintained in a single place.

  - 'database' argument now parsed and used by OpenBazaarContext as 'db_path',
    this avoids confusion with a Obdb object. On the command line, users can still
    pass the --database parameter, irrelevant inside the codebase.

  - Periodic IP Checker for users trying to run on Tor now optional.
    Use runtime option '--enable-ip-checker' to enable periodic ip checking.

  - New parameter '--log-level' to change log verbosity.

  - Refactored signatures of MarketApplication.__init__, CryptoTransportLayer.__init,
    TransportLayer.__init__(), openbazaar_daemon.start_node(),

  - Removed code execution on openbazaar_daemon, argument parsing was redundant
    and this code will be (hopefully) unnecessary as we'll be getting rid of run.sh
    by the end of this feature branch.

  Had a chance to learn even more doing this, I may have some questions about the
  market_id when not specified. I couldn't find where it's generated @hoffmabc

start openbazaar_daemon in daemon thread, reuse defaults dictionary instance, pep8

trying to load libcrypto and libssl didn't work. When DYLD_LIBRARY_PATH is not set on osx, we'll just prompt help message and kill the process

Make sure database environments are setup correctly, including for development mode.

breakdown refactor on startup, OpenBazaarContext creation in its own method.

Updated transport tests, passing.

new --disable-stun-check option

Cleanup, new simplified "openbazaar" bash command

* Invoke node/openbazaar.py and gives back control to the user on the command
  line. Binaries for each platform will be necessary to invoke the python
  process that starts/stops OB.

Pure python launcher now equivalent to run.sh.

Just needs --config parameter to accept a configuration file on startup and I'll submit this
as a pull request to develop branch. pep8 compliant, all python tests pass.

Will also need to merge latest changes after this point, to make sure this will be easy to merge
with latest changes on master.

 - Supports development mode, launchers multiple instances, makes sure every instance has db setup. refactors.
 - configure.sh: make sure to use env/bin python tools, small refactor.
 - requirements.txt: fixed pystun requirement
 - openbazaar (posix CLI launcher) makes sure openssl library is in DYLD_LIBRARY_PATH if running on macosx.

 Fixes on transport.py:
 - commented out inet_pton calls. inet_pton wasn't actually
 doing anything except raise exceptions. in the event that
 inet_pton would actually work, its output was not being used
 to obtain the ip in raw network format anyways.
 - now when we shutdown transport, we make sure the zmq event
 stream is closed properly.
 - in case the market_id is different after we load the settings
 we make sure the OpenbazaarContext object knows is updated.
 - ipv4.icanhazip.com fix on periodic callback updater (fixed merged from master branch)

Search pylint from virtualenv bin.

Style fixes.

Dev nodes.

* Normalizing commit. The changes inside should be reverted.

Changes after first round of reviews.

 - removed sudo call when using ./env/bin/** on configure.sh
 - os.path.join
 - initArgumentParser renamed to createArgumentParser as it is a factory method.
 - defaults not passed as a method parameter, always generated from get_defaults to guarantee
   the map hasn't been tampered with (immutability ftw)
 - new util.is_mac() to check if we are on macosx. uses platform.uname() for better compatibility.
   didn't code is_linux() nor is_windows() as I don't have a computer to check on the actual values returned
   by platform.uname()
 - assert statement without parens
 - OpenBazaarContext subclasses from object.
 - """ for doc strings.
 - renamed camelCased methods to python_style_names.
 - start_io_loop now on the same thread, no need to make it on another thread and then join.
 - zmq io loop installation moved to openbazaar_daemon, no necessary at the launcher script.
 - bye bye run.sh

more fixes after comments.

 - got rid of all 'E501 line too long' warnings on openbazaar.py
 - made sure no defaults were missing when defining arguments
 - got rid of unused help messages.
 - added more examples on how to use the launcher in usage
Supports loading config flags from file, other suggested fixes.

- supports --config-file <file> option.
- cyrpto_util has no os specific code. Mac's DYLD_LIBRARY_PATH check moved to openbazaar_daemon.py
- suggested fixes on comments.
- fixes import issue on test_transport.py

Still to do:
 `$ openbazaar stop`
 `$ openbazaar status`
openbazaar stop [WIP]