Added karma JS test runner

- added karma to run Jasmine tests with PhantomJS
- added core.json to list basic dependencies
- added mock JS to pre-init variables that are normally provided by
  lib/js/config.php