Redone framework for keyframes and layers

Should have basic functionality relatively soon.