fix emulatorFromTrace, rename, add tests