Added serialization to the chunk class.

Decided to add curly braces to all if statements.
Decided to go with the staggered curly braces for statements.