Fix issues with nested namespaces

`#resource(s)`, `#redirect` and HTTP routes weren't working correctly with nested namespaces. I included the failing tests.