Append uncaughtException listener to process to avoid crash.
Fix bugs in the test cases' code,to help generate a stable result.
Update Mocha version to avoid stoping while test case failed.
Merge pull request #1825 from gitchs/case-improve

Improve tests directory