[lib_rewrite] rewrite lib/array.js

In that commit there are : 
+ the rewriting of lib/array.js
+ the rewriting of call sites calling deprecated functions

Florent