Added DataComparator function to sort the data by x-position
Sort the data array after it's created so it goes increasing from left to right. This makes the resulting curves look nicer.
added an 'id()' and id(int id) method to Data to help with updating the ids of the units once the data array is sorted.