add support to write value class to json4s