Refactored the control_system and the simulator stack

All the modules inside these two stacks have been refactored.