Fixed serialization issues. Added test runner to project.

Added a really simple unit case to test.cc. Feel free to add more.