Merging support for loading new resource states at runtime to 0.5.1 branch.