Delegate layer creation to an overridable method.

I did have a few other changes that I wanted to Layer itself, but it ended up being too much, so I present this instead.