Refactor layoutAttributesForElementsInRect to use Array rather than NS class