Simple JS function that splits an array into roughly equal-sized parts with a given predictability