fix inheritance with block-style nested routes

Namespaces weren't being inherited when using block-style nested routes.

This patch fixes it by delaying the call to the code ref until after it's added to the parent route, which is where the inheritance is handled.

Test for it is included.