Improved build logic to train only when it increase cap.

This yields an end result of +4 SP at the end.
Some basic building blocks for training.