ScriptManager: fixed crash (mocha --debug-brk)

Modified ScriptManager.addScript to immediately add the script in the internal
registry and load sourcemap later.

This change fixed a crash when debugging mocha unit-tests, where 'break' event
arrived immediately after 'afterCompile' and node-inspector could not find
the script where the program stopped, because registration was wating for
for 'scripts' response from debugger.
ScriptFileStorage: improved detection of app root

Improved detection of application's root folder to handle better the case
when we are debugging a simple application with no node_modules/lib/test
subfolder.
squash! ScriptFileStorage: root detection change

Yet another improvement of root folder detection. Now we consider a folder
as an application root iff it contains `package.json` file.