Remove code-duplication from ByteBuf implementations.

Motivation:

We had a lot of code-duplication in our ByteBuf implementations which make it really hard to maintain in the long term.

Modifications:

Add utility classes for heap, direct and unsafe direct ByteBuf implementations and make use of them

Result:

Share a lot of code and remove duplications. This will lead to easier maintance in the long term