Cross-fold validation

Adds cross-fold validation and a new example demonstrating usage.