Refactoring Simulator, Memory and main. Not done yet.
Refactoring function prototypes.
Finished refactoring Simulator.
Major refactoring completed.
Fix test file.