Added many comments and minor bug fixes to the DarwinPlatform module