Use apply_indexing for input index computations.
Use apply_indexing for input index computations.

For this to work, we need a folder, so add that too. We kind of
rely on the folder to work most of the time (for caching of
instructions). There may be some dragons here, I'll probably rewrite
that stuff at some point.

This works around the remaining known miscompiles. The issue
must be somewhere in LLVM and be related to GEPs with subtractions,
but I lack the skills and resources to actually track it down.
