Add standalone package installer for chapter 1.

Add standalone package installer for chapter 1. Add check before
installing package for sample scripts in chapter 1.
Add missing check before install.packages

Add missing check before install.packages in 1.4