add tree walker for generating a linear list of opcodes for multiple templates
make range work after inserting