kogmbh/WebODF — pull request #399 by kossebau (2014-02-17 15:54:03+00:00)
Title: Fix broken automatic loading of manifest.json at script location when executing runtime & cleanup

Facts:
1. When runtime.js is called as a script, to execute some other script with itself as runtime environment, it is getting the path from the passed script argument in a broken way and sets the currentDirectory to it.
2. If there is a current directory set, runtime expects to find a manifest file there.

Problem:
Filenames with absolute path or no path prefix were handled as if there was no path, thus not setting the current directory. So only for filenames with a relative path a manifest file was read from the script's dir. This behaviour was worked around by e.g. calling ```${NODE} ${RUNTIME} ./tests.js```, so with a ```./``` in front. Just, on Windows the drive letter prefixes in path breaks things even more, because absolute path no longer start with a /, thus current directory will be set to the drive letter prefix (e.g. ```C:```).

Patch fixes that by always trying to load a manifest from the script's directory, but allowing the load to fail.

Also moves any (wrong) settings of currentDirectory/libraryPaths out of compiled-sources using code.

Still not happy with the hardcoded defaults of libraryPath, but that is left for another time, so far does not get in the way.

Substitutes #392