Serialized library

Hi, I extended Serializable for a number of classes. This was needed for use on Spark.