Add support for custom macros, closes #119