Use printf (portability)
Simplified compare_version() and use printf again.
Overhauled for unit tests and improved POSIX compliance.
Implemented first unit tests.