Slightly improved test framework, now returns number of failed tests as exit code and doesn't rely on an arbitary static init sequence.