[WIP]collect aws cloudformation templates and stacks at Amazon refreshing

The user can directly create a fresh new template, using an editor or upload a file (to be added to the UI). Here during the refresh, the template is extracted from the stack. But template can be reused to deploy another stack in any place. If two or more stacks are based on the same template, only one template is inserted to db. I have explained this in the design document in PR #523