A few bugfixes and refactored methods

Hi Josh,

I fixed a few things in the iOS sdk code and wanted to share it with you. The methods fix the signin and logout features but I did not touch the signup methods (which will probably need some fixing too at some point).

Have a good day!