Molecular orbital theory for infinite molecular aggregates: Application to idealized hexagonal and cubic ices