Bug fixes and finished default template

Bug fixes to make sure pagination works, added template changes to allow ordering of fields and pagination
Changed how row to be ordered is matched

Now will default correctly
Updated templates and fixed minor bugs

Now calculates the count for the rows correctly.