Moving agent's code into a new vttablet library.

I will need to change it soon, might as well move it first.
Merge commit '5baeefe618e9808b063899f9bbc946b3859ebe42'