Move some file-moving code from server into engine where it belongs