Keep database separate.
Better compute square sizes.
Major cleanup of resizing / redraw code.