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 
That's true. It might be better to add `sync_if_need()` to `VIEW_VALID` (and rename it to `VIEW_VALID_AND_IN_SYNC`.