New spawn process system

The spawn process system has been rewritten from scratch and
now it also support Windows so it is multi-platform.