Fast algorithms for surface embedded graphs via homology