Reworks template rendering to properly map tile indices
to tile hashes in the generated javascript. It is slightly
less efficient as it stands now, but after a great deal of
hours, trying to figure this out, I a tired of it and just need
it to work. Can always revisit this later. There are more things
to do now.