Optional externals in amd use globals instead of an explicit dependency

There isn't any mechanism in the amdjs spec to provide optional
dependancies (although a requirejs loader plugin could do that, it's not
standard). The best approach found was knockout's optional dependancy on
jquery, for which it doesn't use require, it only uses globals.

This solution will need to be improved for use of requirejs/amd in
commonjs environments, and could be toggled with a flag.
add 'umd2' libraryTarget for optional amd dependancies as globals
Update ExternalModule.js for umd2
Make stats version output configurable
Merge pull request #389 from Chrazy/stats-patch

Make stats version output configurable
add a semi-colon at the end of the UMD template

Rationale: the missing semi-colon can cause bugs in some edge cases where webpack
is used to generate a library that will be concatenated in dependent project.
Function name cannot contain -

When output.library contains a - the generated function name is not
valid.  Replace - with _ to create valid function name.
Merge pull request #393 from qraynaud/master

Add a semi-colon at the end of the UMD template
add test case for source-map bug
1.3.3-beta1
add hideStack testcase
added test cases
Replace ad-hoc identifier cleansing with helper function

Generalized identifier cleansing to replace invalid (and unicode)
characters with underscores to ensure a valid function name.

Applied function in other places functions were generated based on
libarary name.
add entry-not-found testcase
fixed substr bug
Merge pull request #394 from kurtharriger/FixHotUpdateFunction

Function name cannot contain -
fix module.hot.data
fix this.applyPluginsWaterfall("module-obj", .. call in MainTemplate.js
Merge pull request #404 from undoZen/module-hot-data

fix module.hot.data
add hot self accept with error handler