Split into multiple modules.
Clarified required modules.
Made tests work in npm.