Add support for chunk extensions
Fix off-by-one error in chunk header size calc