Buffalo mass shooter allegedly wrote of 'replacement theory'