#402 Move compilation functionality to compile goal