made utils.array* generic methods

I've modified utils.array* functions to use generic types. Much easier to use them in strong typed fashion.