Moved all JS files to a separate directory.
Implemented the full emulator functionality.