a bit of code organizing and cleanup
write (encodes) png buffers

0. adds JS land args validation
0. adds examples
0. updates readme

0. closes #20
adds tests to png encoding (#20)