Remove unused code.
Restore the matlab CCA code as a reference.
Add more parameter checking to the CCA implementation.