add loc option to exec test
don't lazy set templates, can't even remember why i did this
optimise traverse, improves traversal speed by 50%