Improved OSX compatibility
require() & tests fixes