move template stuff into layout
fix on Ruby v 2.0.0
make user pages work