Localize tmp

now writes boilerplate header to ~/tmp instead of /tmp, because writing things to /tmp on a multi-user server is stupid.

too many commits in this, but i did not rebase, because i need this fix in now rather than later, and squashing would only save my pride.