Now that clearIrqStatus also clears the pending flag, reading the IRQ flag no longer has to, making this more reliable.
This is a nearly complete implementation, except that the Dio1 interrupt is not yet supported (this will be added in a subsequent commit to simplify review). This fixes #588.