reorg, split off resource resolution utility code out of component.js and into separate file