Generalize loading of resources

This will make it easier to support more resource file formats in the
future, as well as more advanced logic for them.
0.4.0