Refactor DB resource fetching from Resource to Stack

By moving this database call to the stack, this allows a future
change to adopt a loading strategy which avoids one sql call
per resource.

Change-Id: Ie29edaf3ffc0a332db421ad01edfa7445eb806e5
Merge "Refactor DB resource fetching from Resource to Stack"