move some of the helper methods in jxg.js regarding the detection of the environment to utils/env.js