revise compatibility code
more compatibility code
add missing macros
remove iOS 5 support until it work properly