a few changes as per review
added bstrlib source as downloaded
tweaks to bstrlib as per Mac fixes, updated code with review comments
Updated err conditions to free memory and close handles
added some base64 encoding calls as an experiment