Add tests using mocha

and split this module to several parts. kind of creating wheel...