Added support for deployment list

Also refactored code to dry out errors and account getting
Merge pull request #1 from codepope/deploymentlist

Added support for deployment list