Add truncate & truncateFromCenter with test

This should be better right now :smile: 
By the same reasoning, `position` should be renamed to `length`. In the `truncateFromCenter()` method, the variable `length` can be removed. There we can simply reference `this.length`.