Layer system

This is a simple system for managing programs with multiple different parts. It's inspired by State in Amethyst, but aims to be simpler, more flexible and more general.