[BUGFIX beta] Fix substates for nested routes and auto-generated index routes

Including refactoring to avoid duplication which felt responsible for the initial error.

Before this patch substates on nested routes would not reset namespaces, which could lead to:

**Router**
```js
this.route('foo', function() {
  this.route('bar');
});
```

**Generated route**
`foo.bar.foo.bar_loading`

Auto-generated index routes did not support substates, this fix add such support to them.

Note: co-created and mentored by @igorT