Added spawning functionality

So... I basically copied this from Modloader. Have fun! (I tested
already and it seems to work)