Initial cut a a JavaScript proof of concept

The code is not in really good shape, but does basically the right things.  So as a proof of concept it seems ok