A theory of analytic functions in Banach algebras