Beautifully encapsulate table related logic using a custom data source + sorting using directives