Make Tern work with AMD modules

(Hopefully)