first steps towards a generic transformation pipeline for krun

**please review**
Because this method is now being called by the code which handles the substitution of search results, and you get a nullpointerexception otherwise. I can probably revert it if you feel strongly about production code relying on the toString implementation though.