Update library to follow best practices

- Open a persistent connection to the APNs
- Requeue waiting push notifications when an error occurs
- Many others modifications