Router test and support for anon functions in routers