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