Add rename detection to tree comparisons

I'm  trying to add support for detecting renames in tree comparisons using the git_diff_find_similar function in libgit2.  I think I have the back-end all implemented to call the function.  To try to see if it works I've hard-coded the compare function to find renames, but it doesn't seem to find renames at all.  Can someone take a look at this and tell me what I'm doing wrong?