Final cleanup of index.js and standardise responses of root callbacks. Closes #23.