Memory Simulator JS OOP Style