be smart about detecting which tmp dir to use (fixes bug on machines where /tmp is not writable!)
moved statics which don't belong in ResourceUtils into more appropriate util classes,
deprecating the calls in ResourceUtils and updating all callers of those methods