Added Array.shuffle function.
Refactoring.