Fixes to many cms bugs, and now a fully working email template editor