Move route and table partials from actionpack to railties

Fixes #16679