Fix mixing points at start and end of curves
Code cleanup
Increase train speed
Add layout generation test