Started working on writing chunk support

I actually didn't test this yet..

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>