Add array_ref type.
Implement context's API in terms of array_ref rather than raw pointers.