Added unit test framework and updated simulator.js