fixed two script paths
added check for exports being undefined in demo.js when run in a browser