Added some functionality for guessing the types of folders.
Added more robustness to auto_rename.