Implement rmdir
Improve error handling
Update directory st_mtime when modified
Add rollback code when writing the index file fails