added formatting option to editor directive
lots of little things working better