do bounds-checking in translation to intLang

make semantics of intLang raise type error if an index is not within
bounds, since this is what the bytecode will want to do.
add app_to_pat and helpers to automatic rewrites
update no_labs_exp_to_Cexp