Refactoring code, paving way for menu implementation
Reset timer counter once emulation is invoked. Avoids sudden timestep jumps
Fixed a possible memory leak
Avoid keys getting stuck, minor refactoring