Add algorithm for computing immediate dominators

Addresses #679.

Work items:
- [ ] Add implementation.
- [ ] Modify `api_2.0.rst`.