set node factory to loaf
added check for nodeFactory type
mocha tests work with karma