Add serialization for different kinds of features. Not fully working