Revert "Layers almost work"

This reverts commit 0b8ef88c7e8099dd581de5d63a6c2a2acf1d1ca1.
Revert "Revert "Layers almost work""

This reverts commit 3ee8de867a9ec8a4bcb408b9f8294152ae3bffe2.