Split data manager into loader and saver
Add Matlab-like cell function
Refactor the foreground training script