Move emulator time to api.lua, patch os.startTimer, other fixes