General theory of topological algebras