Code refactoring

this code is moved to knife-cloud
code refactoring

This code is moved under knife-cloud
code re-factor and additional test cases