Write coverage statistics to json file

Conflicts:
	lib/coverage.js