checks: Refactor check output parsing

The check output/perfdata parsing is needlessly contrived (and
inefficient, though that is secondary.) This patch adds a cleaner
alternative interface to output parsing, makes better use of available
data structures and, presumably, improves performance. It also (imo)
makes the code a bit easier to follow.

Both ABI and API are preserved, through the parse_check_output function.

I've also added a autotools plumbing for the Check test framework, which
should make it easier to write new tests in the future. Of course, there
are also a number of tests for my changes to ensure the correct
behaviour.

Signed-off-by: Anton Lofgren <alofgren@op5.com>