Primitivity and Synchronizing Automata: A Functional Analytic Approach