Added improved string count function, based on CPython one