refactor($interpolate): remove some unnecessary logic, move functions out of closure

Moving the functions out actually decreased memory usage 3% in the benchmark added in #10411 (according to benchpress when using chrome with the memory/gc params).