Check for proj4 in a way that also works in module environments

This is better than #2330, and it should also address @probins's [concern](https://github.com/openlayers/ol3/pull/2330#issuecomment-48630893).