IE11 compatibility

- Fixed toXML errors caused by undefined strings.
- Cleaned up a few quirks in demos/test.html/js
- Added a workaround for document.currentScript not existing in IE,
  in bootFOAM.js