add test coverage using istanbul

    Statements   : 84.45% ( 1939/2296 )
    Branches     : 71.39% ( 796/1115 )
    Functions    : 87.71% ( 307/350 )
    Lines        : 84.89% ( 1916/2257 )

And we should add more testcase for this.