Index returns either a keyed array or a flat array