Some code refactoring + added tests for remove_file() and remove_directory() functions.