JavaScript port of lmfit