Enable URL rewriting, for nicer URLs. Fix registration to always create a default search state. Fix other bugs.