First attemtps at valgrind fixing...
Was trying to use shared pointers.
Isolated leak a bit - this now runs fine, and confirmed with valgrind, but no subsumtion and actionset selection.
Fixed memory leaks - but not sure if operation impaired...
Merge pull request #1 from timlukins/fix-memory

Fixed memory leaks.