Add support for AMD pattern

Implement issue #11.