carved out base64 encoding from apache.commons.codec