Move all CV related functions into Python

Hide the implmentation details and internal functions.
Make the lasso-specific CV function work without lock limitation

Lasso's CV now can work without worrying about lock limitation per
transaction.