End scene

The complete (core code-wise) end scene stuff.