On Computing Smooth, Singular, and Nearly Singular Integrals on Implicitly Defined Surfaces