split diff, match, and patch funcs into their own files