Noncommutative Gelfand Duality and Applications I: The Existence of invariant subspaces