Added application version checking

Application version is checked at program start, it exits if home dir reports
a different version from the running instance.
Added Unit and Mock tests.