Add support for marking tests as flaky

Review 926 by @tryneus
Closes #736
Merge branch 'next' into sam_97