Tune YARN and MapReduce memory settings

This auto tuning is based on these recommendations:
http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.0.6.0/bk_installing_manually_book/content/rpm-chap1-11.html

(This commit also contains some alignment and quoting fixes.)

Change-Id: I1b778ab426e5659f252ca7ef6c32e0cc80511243