Add support for building using gluejs v2

I had to make some minor changes for compatibility