Significant amount of concurrency issues fixed.

- Implemented proper support for sending messages to connected clients.

  For each client we maintain a queue of messages and of requests.
  Access to both of these occurs under a mutex. Whenever a new message or
  request is enqueued for a client which is currently idle, the event
  loop servicing that client is asynchronously woken up and a
  watch is set on the write end of the socket. Queued messages are then
  sent one at a time within the context of the client's corresponding
  thread and event loop ensuring integrity and mutual exclusion of
  competing threads in a non-blocking manner.

  Asynchronously waking up the event loop proved to be more difficult
  than expected due to weird behaviour in libev's async watchers. After
  many unsuccessful attempts, a custom solution was built. We use an
  anonymous in memory pipe through which we transfer pairs of (flag,
  client state pointer), where flag indicates whether to START or STOP
  ALL or WRITE io watchers for a certain client. Each thread's event
  loop listens to the read end of the pipe as if it were any other file
  descriptor. Other threads can then write to the pipe to signal the
  event loop to wake up and perform one of the four indicated
  operations.

- Fixed new connections being attached to thread event loops outside of
  their respective threads resulting in occasional weird behaviour, due
  to the fact that ev_TYPE_start methods were not designed to be thread
  safe. The fix uses the AsyncPipe described above to pass in pointers
  to the event loop thread.

- Ensure that we only have one persistent connection between each pair
  of machines within the Directory and File layers. When initiating
  connections, we only initiate a connection from the machine with the
  lower id to the one with a higher one and send a server authentication
  message which allows the receiving end to know where the connection is
  coming from and add it to its corresponding Server Group.

- Keep track of Server Group version numbers and pass them along when
  initiating internal connections in order to allow receiving end to
  block until it has up-to-date server group information.

- Fixed typo in cluster coordination code causing connections to dead
  machines to not be closed until timeout.

- Fixed bug which occasionally caused a client state for an connection
  with another machine in the cluster to be destroyed twice causing a
  Segmentation Fault.

- Fixed main_post_init being called before all worker threads were
  properly initialised.

- Moved cluster registration (and ZooKeeper watch registration) to
  main_post_init to avoid a race condition on bootup.

- Fixed memory leaks in Msg(Request|Response)(Batch)? classes.

- Use SO_REUSEADDR on listening socket to allow quick restarts of
  machines rathen than requiring the socket to exit TIME_WAIT.

- Properly separated unit tests from main executable and added
  end-to-end tests for cluster coordination.