Changing sort()

We have had many bug reports on `sort()` with apps crashing now and then (but consistently). Changing `sort()` to be an in-place sort will help core to deallocate only when allowed.

A few extra changes done:

* Fix spelling error in the sort order constant (it is now called `SORT_ORDER_DESCENDING`).
* Throws an `IllegalArgumentException` if field name does not exist.
* Validate the table view before calling any method in core.

@benjaminprakash88 @bmunkholm @emanuelez @cmelchior 
We surely have to the that VIEW_VALID before calling sync.
But what about the other parameters? Shouldn't the view be updated, before we check those out of range conditions?