JavaScript library for term rewriting