replace base64 implementation taken from

http://www.adp-gmbh.ch/cpp/common/base64.html

fix #173