ensure that the layers are valid javascript names