Minor Refactoring for layer.visibility()

Updates how the display of layers is handled to better integrate
carto.layer