Replace second set of #defines with templates in JS_Define.h