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.


@omidaladini @johnglover @gavinmbell 
Yes, I was concerned about that too (actually I put a lot of effort in the previous changes to keep them out of the loop). The plan is to address that in the next changes, perhaps even removing the lambdas. I didn't want to do too much in this pull request so I ignored it for now.