Metadata layers

Here, we explicitly tie metadata to a specific layer, so we can do per-layer collision detection (and other things, coming soon!). Also fixes some bugs with zone detection and handling of current layers.