Include indexjs in gulp

The entire module lives in `index.js`, unfortunately gulp lint was only running against `/test` and `/lib`.

Also fixes the linting errors gulp now produced and some other code style issues :smile: