moved querys to models
added tpl for user page
created redirect function
refactoring and started on user page