Decouple HTML reporter from core

This is the first step needed to set the reporter interface.

There are still a lot of things to do, but I already want to share to allow earlier reviews, because it's necessarily huge.