Major overhaul to support arbitrary mixed array and structure indices.