Add preLoad()/onLoad() to layer config and loader.