Fix shuffle() so it works, passes unit test. Previous version by @davmillar in #19 mostly worked, but would occasionally return an array with length of original array +1 with undefined as one of the elements