cue: fix regression in merge
This reimplements the template stripper.
It is considerably more code, but easier to understand,
more performant, but more importantly, easier to debug.
Fixes #38.
Change-Id: Id4e6988941b43e47f02cbbd3c2fdfdc10ac2ffa7
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/1880
Reviewed-by: Marcel van Lohuizen <mpvl@google.com>
authored by