Support iOS 4 -> 8

Support for iOS <7 was removed from main branch. Add this back and
merge in changes for iOS 8