Fix strict notices
Make permalink resolver pass the already loaded object to component
resolvers, which avoids many redundant db queries, especially when
there are a lot of different topics.

The former on_resolve_permalink mechanism still works, but should be
considered deprecated