Structure Overhaul + substep model

Separated Model functions from scripts. Added Substep model (work in
progress)