Move trapReceiver and Agent into their own files. Add gocheck unit tests