Level transitions and some refactoring

TIL I can call script functions directly instead of using SendMessage.