Refactored common code to util
Cleanup and refactoring
Switched from urlsafe to integer_id
Refactoring
Added pagination to main page and category view