Report number of files shipped.

Barn-agent reports number of 'files to ship' which when working normally
can be used as a metric of 'files shipped'. However when either (a)
destination address stops working, or (b), the local process starts
emitting lots of log files then the 'files to ship' goes up. Adding
this metric makes it possible to distinguish does failure modes.
Make failover timeout configurable.
Merge branch 'master' of github.com:soundcloud/barn
Merge pull request #15 from soundcloud/conor/report_num_files_shipped

Report number of files shipped.
Roll out new version of barn-agent.
Fix param change.
Add some comments.
Enable -Wall on compiler.

And fix issues, which includes remote global REMOTE_NAMESPACE strings
(these needed to be configurable anyway).
Enable testing of barn-agent.cpp.

To test the overall logic of barn-agent log shipping this change
breaks out inherently stateful parts (e.g. filesystem) into objects
that are passed into the functional part so that testing can be
done.
I hope that I've been careful enough with this refactoring that it
is a no-op functionally. I intend to add tests of current functionality
to allow future changing of the code without worrying about introducing
regressions.
It somewhat breaks the style of the functional code to introduce objects,
but I think the only alternative is to mock out global functions. While
possible I think there's still so many stateful like functions that
having a class to just group them is worthwhile.
Rsync + filesystem operations are in one class which is a bit messy but
I didn't want to go too crazy on introducing/passing objects.
Merge pull request #18 from soundcloud/conor/test_barn_agent

Enable testing of barn-agent.cpp.
Add some barn-agent.cpp tests.
Merge pull request #19 from soundcloud/conor/test_barn_agent2

Add some barn-agent.cpp tests.
Continue to add tests for existing functionality

(to prevent regressions).
Add gmock.
Fix reporting of partial shippment.

Previously when barn-agent shipped a few files but then failed it
didn't report the number of shipped files before failure.
Remove 'fold' from barn-agent loop.

The fold makes the code safer but I think it is at the cost of
the code being readable for someone new to the project. I've
removed it to hopefully make the steps easier to see.

This change also ensures that barn-agent doesn't failover when it's got a
'flacky' connection i.e. where it's managing to ship some files out of the
entire list. In production barn-agent can often end up running like this.
Add logging directory to tests.
Send metric if barn-agent is shipping all log files.

This is a good sign that something has gone wrong. Either barn-agent has
failed over or something has gone wrong with the middle node.
Allow both telemetry reporting and channel failover to be disabled.
Fix single character command line arguments.