support for conditionals in macros

Still need to add tests and doc updates.