Refactored file system interaction as well as path and URL handling.
Updated command error messages.