Initial split of rendering into mime files.
Move code from types.jl