Adds binary serialization/deserialization.
Refactoring, addressing review comments
Merge pull request #5 from localmed/MR-11/binary-serialization-deserialization

Adds binary serialization/deserialization