Some restructuring.

Added the ability to redefine the inserted HTML entities.