Ternary compounds in the magnesium–titanium hydrogen storage system