Refactor Base64 decoding from HTTP server to str.c

Also add a Base64 encoding function, not tested yet
Fix off-by-one buffer size errors when using tohex()