Now terminates when all agents die. Some general tidy up. Resolves #1