Replaced word counting regex with something that dodges the incompatibility with JS and is more performant too.