Refactors quasiquotes' apply and unapply macros to reduce code duplication