Moved M, O, D functions to own modules.
Moved lib/mod.js to lib/index.js.