Reworked math classes to be Serializable.
Added remaining classes to math package.