Ground-up rewrite of the Javascript Spectrum emulator