Tmp corr tools

Here is a rebased version of the correlation tools PR.  Hopefully it is OK to merge, but let me know if there are issues.