Improved exception handling to handle external JS and CS files. Added include global, which needs documenting.