Fixed setting whole script source in controller, moved recursively flagging changed quantities to script