Adding isValidLocation() to preferred_locations.

Adding an isValidLocation() method to the preferred_locations module.

This will be used by ui/components/user_locations to validate if a component may be preferred.