Performance improvements

Pre-compiled regexes and rearrange class variables and properties.