moved colorizing into util.js, output error messages from document