Smarter spawning of the ghosts

Separated ghost logic to a GhostAI class.