Added package.json and started using node module syntax.

Also moved example data to example file.