The Thue-Morse substitutions and self-similar groups and algebras