Add AMD/ymodules support

I'm not sure whether ymodules support is done in a proper way, but probably it's okay.