Extract resource loading to xblock utils

You are right. But I don't think this will get duplicated, so I will just leave it this way.