Most of this commit is refactoring the spawn logic so that we can reuse most of it to handle spawn requests when there is no GUI window.
Most of this commit is refactoring the spawn logic so that we can reuse most of it to handle spawn requests when there is no GUI window.