Refactor elmacro-mode
Minor fixes