WIP on JS bindings

This is me and @JanEggers futile attempt at getting somewhere with the #159 stuff. The stuff is nowhere near being finished, but let's start somewhere, shall we?