R code update

Functions for data preparation and model fitting (any number of
categorical and quantitative variables; verified that a reasonable fit
results). Functions cross.val() and grad.fit() are in progress.