added first implementation. see dev/test1.js to see how it works and how far it has come.