Refactor a bit

* Rename ARRAY type to array
* free memory inside merge_sort() instead of merge_arrays()