Make generated `index.js` more useful

Closes #4.