Move runtime into separate module