Use IE compatible Array functions

IE <= 8 doesn't have some common Array methods.