Added an array.remove function to wrap usage of array.splice.