Refactoring beforeOn, afterOn tests and upgraded to latest snapshot of Kotlin.