improve aws credential loading code
fix up tests for base64