result: uncouple Result() text parsing, handle comments
roshi and I agreed it would make sense for the Result() object
to be more general purpose - a change from its initial design
which was kind of innately tied to the process of parsing an
instance of a wiki template. Now, a Result() is a fairly generic
class with a set of basic result-y properties. The {{result}}
template string for the result is one of its properties -
the awkward helper function for producing {{result}} strings
is no more. There are now two class methods which produce
Result objects from the two known templates. So if you're
parsing existing results you use one of those; if you're
creating new results you instantiate Result directly.
As a kind of bonus while doing this re-arranging, I threw in
comment handling. When parsing, all the text after the }} but
before either the next template or the end of the current line
is considered to be a comment for the result. We also now
parse bug reports out of the 'comment' for the old testresult
template which didn't handle bugs. When producing the template
text, the comment is just stuck on the end, exactly as-is.
This means that if you want it wrapped in <ref> tags you'll
have to provide it that way - there are cases where comments
don't get wrapped in <ref>, so I didn't want to bake that in.