Initial operational script.

WIP. Debug values enabled and lots of TODO markers to clean up still.