(nm)
various bugfixes and a first mocha test later..