Rewrite unit tests for kbn.js