A Gröbner basis criterion for birational equivalence of affine varieties Triple-point-free degenerations of surfaces with Kodaira number zero. Appendix: Euler characteristic of complete divisors in threefolds 