Made some DB changes to improve server prerformance

Also I changed the base page rendering which provides better URLs in
most cases.