Enclose all core functionality into a single file, expose one global variable to allow access to functionality.
Add a unique identifier for current document's ID.
Renamed core.js to eCore.js
Renamed eCore.js to Core.js
Add contextId() function.
Split the code into several files.