added userpage stuff, refactored templates