Make the script use interrupts, instead of sleeping + checking
Handle HTTP-exceptions when doing PUT and POST requests.
Merge pull request #2 from hermansc/interrupts

Uses interrupts instead of sleeping