Fix fs.rename and add tests for it