Convert .tty file to .js file, suitable for replaying with ttyreplay