Planed the edit-mode functions, restructured some functionality for creating HTML as preparation.