replaced the tangled mess that was DocumentRepository.transform_html (and friends) with a new Transformer class