Create KmeansImpl class so support generalized weight functions and
divergence measures without breaking binary compatibility.
Made backward compatible.