Port MOSREF 'fork' command from mosvm

I did this awhile back but forgot to do a pull request. Ports the 'fork' MOSREF command from Mosquito.