Improve version check.

Move version check so it is the very first thing we do.
Perform version check for all platforms
Ensure backwards and forwards compatibility

Resolves #689