Added base64 implementation in C borrowed from stackoverflow