Refactored phonegap detection. Added more content.