Added .gitignore
Use portable_rename to support Windows
Handle backslash as directory separator on Windows