Provide configurable parser for varnish log lines.

varnishncsa (which emits the log lines we get from the bits hosts) takes
a format string as an argument that specifies which fields to include in
each log line and how to arrange them. For example, we current run
varnishncsa on bits with the format string '%q %l %n %t %h', which maps
to: "<query string> <host> <seq id> <timestamp> <client ip>".
For details, see
<https://www.varnish-cache.org/docs/trunk/reference/varnishncsa.html>.

The idea behind this change is to provide a parser that can take the
same format string and use it to parse a log line back into its
constituent values. The scanf to varnishncsa's printf, if you will. This
simplifies client-side and server-side log handling considerably. With
this in place, we simply invoke a separate instance of log2json for each
log stream, like so:

  # Client-side events:
  log2json '%q %l %n %t %h' tcp://localhost:8422 tcp://*:8484

  # Server side events:
  log2json '%n %l %j' tcp://localhost:8421 tcp://*:8481

The change includes tests, and a tox.ini configuration for running the
tests on 2.7 and 3.3.

Also bundled with this change is the aggregation of all exported
functions in __init__, to avoid having to import from submodules.

We cannot push this update out until we deploy the updated logging code.
The server-side code in this patch expects 'encapsulated' events.

Change-Id: I6e19766c3580f2e8ac82c687d592be5da8f14718
Use io.open(sock.fileno(), ...) on both 2 and 3

Unlike sock.makefile(), this works the same way in both Python 2 and 3,
eliminating the need for its inclusion in the compat module.

Change-Id: Icc8f810ab2ff1850ec704a53144f92873a1aa8ab