updated example.js, added npm scripts

`client/example.js` hasn't kept up with client lib changes.

Fixes #408

Also snuck in some npm scripts :dog: 

@chilts @rfk r?