Add support for marking tests as flaky

Review 926 by @tryneus
Closes #736