Getting started with JS stuff.
Factor out _written.
Added node test, pad perfs too bad :-)
Merge pull request #7 from savonet/JS

Javascript binding.