Small performance enhancements

Get rid of half filled heuristic and use unsafe array indexing because
the indices should always be correct.
add test
Merge pull request #357 from polyphemus/cut-bytes-rewrite

Small performance enhancements for cut: bytes cutting
Merge pull request #354 from mahkoh/test

Implement test
test: fix build
Merge pull request #358 from Arcterus/test-fix

test: fix build