rewrite lib/gearsloth.js and tests
Merge branch 'gearsloth'