Simplify erlang translation var building
Speed up how variables are merged by keeping a counter