Instead of doing lc($text) everywhere it is needed, use $lc_text everywhere after get_hiero.  Convert #28 to use templates from database.