Move per-cube state into it's own structure