Added template injection, sort functionality, sort on btn click, and popovers