Moved WMS layer encoding so that it is done at the time sub dataset URLs are created.