Add sorting and top support to commerce data source and fix bugs