Added a shuffle impl. for JS.