merge of feature mocha/YUI sandbox/share test params

Hi Pranav, i have merged from master's latest code and feature of mocha/YUI sandbox/share test params(jun's PR) together and run unit test and functional test,found some bugs and did some fix, for now seem ok. please check, and also the previous two PR may be ignored. Still we need more test.