Adding some more comments in the project, and moving global error handling to core.js