Handle edge cases around member routes in template expansion

- member routes are always moved to the end of the eval (so they are
matched last; routes in the template have priority)
- update member route paths when changing nested_path from within a
template