I noticed an #ifdef TEX2LYX in the patch. If that does what I think it does, then a quick and dirty fix for the AMS problem with tex2lyx would be to include appropriate such code in the TextClass::read() routine that would make tex2lyx treat the DefaultModule tag like Input. I.e., something like:
Isn't there a way to ask instead TextClassList (or whatever it is called these days) to return us a textclass with the modules loaded
(something like that is done for buffers already...)
It would be better than this hack. JMarc