Clean up how filters are set on routes.
Rename stub files to stub extension to not confuse IDEs. Fixes #1158.