Start of new editor API
Converted macros to new editor API
Whitespace fixes
Fix double-encoding issue
Several macro bugfixes