Add functions & cleanup install_puppet.sh

A small clean-up of the install_puppet.sh script to enhance
readability and to simplify adding support for extra distributions

 - add distribution check functions
 - move puppet installation for each distribution into its own
   separate function
 - move pip installation into a function
 - add/expand several comments

Change-Id: I5d5f71fde607ace528b7372e2deadccbea58bd2f