Added ability to configure field constraints and choose serialization type

My code maybe not so perfect ^_^ Dont judge me strictly.