Refactor VMChooser to select from a list of candidates, modify the codebase and add unit tests