Pre-lunch commit: part way through refactoring of how media attacments
work (removing temp files).