change function mode to nodejs and add mocha test framework