Factor out common code in Kotlin{,2Js}.compile
Remove redundant Unit return type declaration