Only generate factory methods if they are used
Set serialVersionUID in case they are ever serialized
Suppress some warnings