Completed first stage of the large refactor
The refactored code compiles basic examples, bounds checking and tracking need to be added