Changed ResourceDatabase to ResourceLibrary and added loading/caching functionality.