Abstracted out the action method into docpadUtils. Cleaned it up a bit. Added it to files.