Improved helper classes.
Added JavaDoc.
Added functions for use by agent.