Added cascade correlation algorithm.

Added the cascade-correlation algorithm and fixed some related issues in the code that the algorithm depends on.

Removed the per-iteration shuffling in NN problems.