Added a generic function to split a data frame into test and training sets.