Refactored launching & stopping of agents.
Added documentation.