some refactor after reviewing with Simon
Merge branch 'master' of github.com:pryv/lib-javascript