Add ARRAY_SIZE macro, and use it where possible.