make array utils work on arbitrary containers and have functional programming funcs