This never used to happen to me so this might be due to a change in how PHP handles strings or it might be due to my own ignorance but I had to double escape an e to use the equations tag. I changed
'replacement' => "drutex_render('\begin{align*} $2 \end{align*}', '<var>format</var>', '$1', 'tag=\"table\" class=\"displaymath\"')",
to
'replacement' => "drutex_render('\begin{align*} $2 \\end{align*}', '<var>format</var>', '$1', 'tag=\"table\" class=\"displaymath\"')",
Otherwise latex failed because the align environment was not ended. I'm not saying you should always do this. Maybe on another system, two backslashes would break everything. But if you make a code check for this caveat it would probably save people the headache.