standard functions, folds
added validation step
added check for parent directory (for when I try to chdir into a file instead of a directory like a dummy)
Major revision
- Replaced clumsy error handling.
- Added support for recursive searching when the target is not a directory
- Better validation of user input
- Delineated work units into separate functions.
- Unset the helper functions when exiting.