Auto sidebar generation

Also play with permalinks so URLs are sane