refactor example test runner to separate out doc parsing