function Timer() {
    return Qt.createQmlObject("import QtQuick 2.0; Timer {}", root)
}

/**
 * Wait for `delayMillis` milliseconds, then call `callback`.
 *
 * @param callback a function to call after `delayMillis` milliseconds have passed
 * @param delayMillis the number of milliseconds to wait before calling `callback`
 *
 * @return an object with a function attribute `stop`. The `stop` function takes
 * no arguments, and when called it aborts the delayed execution of the
 * `callback`.
 */
function delay(callback, delayMillis) {
    var timerAlive = true
    var timer = new Timer()
    timer.interval = delayMillis
    timer.repeat = false
    timer.triggered.connect(function () {
        callback()
        if (timerAlive) {
            timerAlive = false
            timer.destroy()
        }
    })
    timer.start()

    return {
        stop: function () {
            if (timerAlive) {
                timerAlive = false
                timer.stop()
                timer.destroy()
            }
        }
    }
}

// Shim for String.prototype.startsWith(), added in Qt 5.8
// Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
function startsWith(string, search, pos) {
    return string.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search
}

@@ -1027,16 +1027,623 @@
    %7D%0A%7D%0A%0A
+/**%0A * @param lst a QML basic type %60list%60 value%0A * @return the %60lst%60 converted to a JavaScript Array value%0A */%0Afunction listToArray(lst) %7B%0A    var result = %5B%5D%0A    for (var i = 0; i %3C lst.length; ++i) %7B%0A        result.push(lst%5Bi%5D)%0A    %7D%0A    return result%0A%7D%0A%0A/**%0A * @param arr an Array or QML list of objects%0A * @param name a String containing a property name%0A * @return %60arr.map(function(item) %7B return item%5Bname%5D %7D)%60%0A */%0Afunction pick(arr, name) %7B%0A    if (arr instanceof Array) %7B%0A        return arr.map(function(item) %7B return item%5Bname%5D %7D)%0A    %7D else %7B%0A        return pick(listToArray(arr), name)%0A    %7D%0A%7D%0A%0A
 // Shim 
@@ -1930,8 +1930,184 @@
 earch%0A%7D%0A
+%0A/**%0A * @param arr an Array of numbers%0A * @return the sum of the numbers in %60arr%60%0A */%0Afunction sum(arr) %7B%0A    return arr.reduce(function(sum, next) %7B return sum + next %7D, 0)%0A%7D%0A

Add functions listToArray, sum and pick to Utils