Refactor rm and rmdir to use File

Fixes #3