Updated inherits to extend within templated index files

I noticed the `util.inherits` code got ditched in favor for extending, but this change never made it to the templated index.js files. Not sure if that was intentional or not, so I prepared a pr!