Simple encode64 fn, more complex main fn.