array methods cleanup

Also fixed Firefox regression (array.shift stopped working)