Simple data validation on init

Added a few lines to prevent core.init to proceed if data is either an empty object or null. I also added a callback that run those cases.

Dummy callback function added to the index as well to show how to use it.