layout: Employ a persistent list data structure to avoid copying floats
all the time.

Improves performance on the maze solver significantly since this was
basically O(n^2) before.