Fix macros

- Add a test for macros.
- Re-add setting for macro that was erroneously deleted.
- Fix bug where macros appeared at end of source.