add foreign indirect, rearrange opcodes, type cleanups