Refactored Template editor. Changed alle CRUD actions to ajax.