Adding 'primary' group if not defined
Using sort_by_weight()
Fixed test
Added test for elements weight
Added the Pagination class