Added simple OS detection to Makefile.
Overhauled logging.
Minor fixes to test cases and cleanup in logging.