Added cleanup() and reset() functionality to ScriptingCore. Also added functionality to set an externalScriptPath.

This PR is best viewed with whitespace changes ignored: https://github.com/cocos2d/cocos2d-x/pull/2017?w=1

The methods ``cleanup()`` and ``reset()`` are necessary i.e. when a game is not just a single screen (i.e. an Android Activity), but a screen is destroyed and recreated, there should be a way to reset the ``ScriptingCore``. On Android the GLThread changes when the Activity i.e. is destroyed and recreated. Touching the ``ScriptingCore`` causes a guaranteed crash. -> When the 'screen' is destroyed the caller has to ensure that the ``cleanup()`` is called from the same Thread. This change was developed with @funkaster and @folecr.

The ``externalScriptPath`` is very useful i.e. when debugging on the iOS simulator, one can redirect the path the scripts are loaded from to the host machine (On Android i.e. to the SD-Card), allowing to change the JS files without recompilation and even without restarting the app.

Also removed a good bunch of trailing whitespaces.