The gunman who rammed his truck into a Mormon church and opened fire on worshippers was an Iraq war veteran who had previously shown support for Donald Trump.