Use the hashtable for regular expression cache. Introduce hashtable_foreach as well. Just have to make other things use the hashtable now.