Fix #565: Move corejslib.js as a resource for the tools.

This simplifies the tools API.
Merge pull request #586 from sjrd/move-corejslib

Fix #565: Move corejslib.js as a resource for the tools.