Implement renaming on windows

(Not actually tested)