Implement common_prefix and rel_path