Add gtest code to barn-agent.
Add the beginning of tests to barn-agent.

Also fix code comments.