Add OSX support and cleanup

	This likely breaks linux/EGL platform which will be fixed
	later