Split out process creation from thread creation. Changed server initialisation to ensure that we always have a current thread.