Yet another attempt at refactoring the commonalities of the various agent classes into a single trait.  This one seems to be working, although it causes quite a lot of compilation warnings (all due to know bugs).