Struggling with Mason variable scope and JS integration