Fixed serialization tests

 - added scaladoc and other comments
 - minor cleanup