Also refactor the command line flag validation app to make it cleaner. Change-Id: Idb7bb33bd3060aaf25765c1575ceddd901b90c4d