Half finished implementation of the spawn() script function