Enabled the optional use of secure connections plus other fixes

- Updated SDK to support optionally using secure data transfers
- Data uploads are now handled completely in a background thread
- Limited the number of concurrent background threads that can be created
- Added SDK eror reporting
- Other minor code improvements
Fixed issue with removing user hash
Corrected coding style