Implement dirname, basename, extname