Added optional resource loaded callbacks, fixed #10