Several small code improvements and additional checks when expecting data in certain formats

Some of these changes were suggestions from a code review from the original library PR:

https://github.com/fruux/sabre-dav/pull/347