First working maze-generating algorithm, and supporting API.