Refactor, format source, add commands to set spawnlimit