Refactored code to introduce CloudEntity interface.

 - Change various classes and interfaces to use Cloud Entity interface
 - Generified some code to enable other types of entities to be added.