interp: Generify translator code

This makes the core translator loop more generic so that we hopefully
can share it the same loop between the interpreter and LLVM and DynASM
backends.

Signed-off-by: Pekka Enberg <penberg@kernel.org>