[RFC] Consolidates macro code

Refactors macro code, and adds triangular indexing for constraints. Also allows to add conditionals to both when that's a viable option. I didn't update the ``@defConstrRef`` code yet, and honestly I'm not sure how useful it is anymore...