Better spec support to allow binary serialization (not finished)