Javascript: Added functions setVar, addBefore, addScript