Speed up String#truncate

Benchmark:
          user     system      total        real
old   1.550000   0.040000   1.590000 (  1.585866)
new   1.250000   0.040000   1.290000 (  1.287693)
Speed up Array#split

Benchmark:
          user     system      total        real
old   0.510000   0.000000   0.510000 (  0.506749)
new   0.330000   0.000000   0.330000 (  0.336187)
Simplify Array#in_groups_of code