Print version number for --version.
Moved error checking for command line options around.
Merge pull request #304 from Microsoft/likeaversion

Print version number for --version.
update LKG
Merge remote-tracking branch 'upstream/master'
moved implementations for different cases in separate functions