copy code from the webgl branch of the compiler

Wasn’t sure how to bring history over, but figured it was not such a
huge deal.