Refactored codebase for compatibility between standard and minimal versions of OS X project.