Push math nodes onto mathArray individually to avoid problem in IE < 9 where push.apply doesn't work on a nodeList. Also, avoid duplicate elements in the array by checking for namespace prefixes. This needs to work for both HTML and XHTML. Resolves issue #672.

Signed-off-by: physikerwelt <wiki@physikerwelt.de>

Change-Id: I0e2071aebee4e524960b01c4a5a10e49b5520846
(cherry picked from commit d463f88c18b16d06d0af30619d6baf2ded489bc1)