Added support for multiple layers with layout. Layout can be set immidiately, or when ever a new layer has been defined.