Abstracted callbacks and code cleanup.
Modified to match the new public api of docgen
Code cleanup.
Renamed index.js to test.js to avoid confusion.
Updated package.json to reflect correct main file.