Experimental rewrite

Untested. Reports conform to new API.