Update index.js

Make use of node's `util.inherits` function for prototypal inheritance.