Improved typechecking/translation of ARRAYS.

Subscript indexing is still broken due to unimplemented
out-of-range bounds checking.
ARRAY indexing works again.