Detect AMD modules even in the presence of comments in deps list

Improved the detection of AMD modules slightly to work even when there are comments in the middle of the list of dependencies.

Note that the regexp is getting a bit large, is there any plan to use something like esprima instead?