Fix generate resource location uri for nested resources

Refactoring ResourceMap builder ResourceLocator and ResourceMap.

Change-Id: Ied5e1136f526d167008bcbd5badb11f19512214a