Router register on publish

Allow Detailed Guides to automatically register/de-register themselves on publish/unpublish.

Additionally add correct Router registration to Rake.

This replaces #1004 as it includes the same commits.