Big refactor. Now also passing root topic to web page to register against.