[MINOR] Cleanup Kmeans algorithm script (table padding/truncating)
[MINOR] Cleanup Kmeans algorithm script (table padding/truncating)

This patch simplifies the kmeans script by folding separate padding and
truncating of table outputs into the table operation itself. 

This also improved performance of Kmeans over Mnist80m w/ 20 iterations,
5 centroids and codegen enabled from 581s to 341s (2,164s w/o codegen). 
apache/incubator-systemml,deroneriksson/systemml,apache/incubator-systemml,deroneriksson/systemml,gweidner/systemml,niketanpansare/systemml,niketanpansare/incubator-systemml,gweidner/systemml,apache/incubator-systemml,deroneriksson/incubator-systemml,apache/incubator-systemml,deroneriksson/systemml,deroneriksson/incubator-systemml,niketanpansare/systemml,deroneriksson/systemml,gweidner/incubator-systemml,deroneriksson/incubator-systemml,apache/incubator-systemml,gweidner/systemml,gweidner/incubator-systemml,gweidner/incubator-systemml,niketanpansare/systemml,niketanpansare/systemml,apache/incubator-systemml,deroneriksson/incubator-systemml,deroneriksson/incubator-systemml,niketanpansare/systemml,gweidner/incubator-systemml,gweidner/systemml,gweidner/systemml,niketanpansare/systemml,niketanpansare/incubator-systemml,niketanpansare/incubator-systemml,gweidner/systemml,gweidner/incubator-systemml,gweidner/incubator-systemml,deroneriksson/systemml,niketanpansare/incubator-systemml,deroneriksson/systemml,deroneriksson/incubator-systemml