Add defineRouter to definer parser
Simplify resource lookup

Always use resource name rather than amd name as the resource name
should be unique for the build.

Additionally simplifies the lookup logic when possible to use the same
lookup namespace rather than custom plugin namespaces.