Additional modularization, misc. resource test fixes. Updates to populat...

...e sql script from mainline.