What is the grammatical structure of "would that it were"?

Would is "archaic" which means old and no longer used. People use "I wish" in place of "(I) would".

I wish I were more handsome. I would I were more handsome. (archaic)

It is well explained in Merriam-Webster. Please click here.

a archaic: wished, desired

b archaic: wish for : want

c (1): strongly desire : wish —often used without a subject and with that in a past or conditional construction

(2)—used in auxiliary function with rather or sooner to express preference 

It is incorrect to assert that "Would that it were" is "no longer used". It is used and understood not infrequently in certain circles, particularly among the literate intelligentsia.

And regardless of its origins as "[I] would that it were [so]", the phrase "Would that it were" de-emphasizes the subject to simply express the wish, much like "Long live the king!" and other subjunctive wishes that omit the subject.