A javascript sequential execution script with callbacks