Added options.amd as a function

Allows greater flexibility for building subtemplates dependencies, current implementation allows only static list on the config. With this change dependency list could be built per template from AST or compiled code.

Thank you.

*CLA's signed*