Implicit conversion to case classes

Changed to rec. Tree can be inferred by the reader since it is macro code anyhow.