Datatable

Added the code to prevent refreshing anything outside of the table when only sorting.

There are other minor changes described in the individual commits.

My main concern is to see whether this pull request works out fine.