Update run_analysis.R

Add unit tests and new comments