Add unit tests for core.js

Will add unit tests for plugin.js