A function that splits an array into a given number of equal-sized chunks. Includes unit tests in Jasmine.