irc: use custom casemap instead of zg
The zg casefolding requires allocations for data, and this bumps our ram
usage from ~7MB to ~60MB. We only need to map a subset of ascii as
lowercase, so create a custom casemap function to lowercase based on the
supported algorithms