Enabling Retargetable Optimizing Compilers for Quantum Accelerators via a Multi-Level Intermediate Representation