clean_multiline_string was used in multiple places across modules in different packages so I simply refactored it into galaxy.util and added a test case (used in multiple places and has tests a lower bar then some other code in galaxy.util).
The tempfilecache abstraction was only used in one place, so I've refactored it right into that file.
Together these should simplify the package tests for galaxy-data (and hopefully other packages also).