Added a better shuffle algorithm.
Changed shuffle method to use Math.rand instead of reinventing the wheel.