[util] Minor refactoring
[buffer] Fix default end index calculation in slice()
[buffer] Implement toString() method