Added base64 encode and decode functions