Add a JS sample, fix require and exit in old samples

- require phantom instead of node-phantom
- remove err parameters from function calls
- add ph.exit calls to every sample
- add a sample written in JavaScript