Streamlined some code and added a config option for chat regex.