Add loop-breaking option to MiniGrace object in JS