Added pagination for profile post history
changed javascript
refactored javascript and user profiles