Huge refactor from other authors + tests

I know this is huge, but what do you think about merging in other work to bring these puppet-backuppc forks together?