Add an option to print the output in AMD style
Fixup and test AMD option.

AMD option now wraps entire output file, instead of individual templates. Also, tests were added for the AMD option.