New crossval

Code for hyperaparameter optimization and crossvalidation.