Add weighted cross validation.

    Cross validation with two strategies: weighted and
unweighted.  Also refactored the cv code into multiple
modules.