Node.JS implementation of optimality theory