Add unit test with mocha.
New extend mechanism.