upgraded apns protocol to the newest version; added basic error checking for apns
minor refactor to make sure there're no dangling sockets and files
aps_data -> apns_data; it should be more intuitive now