only run in browser
wrap jsmad so the global scope is a little more clean