use standard project coding style

- wrap long lines
- use explicit iterators
- avoid stacking conditionals
keep result processing out of main function

_getVirtualMachines() now returns the final list of virtual machines
objects