string.js: started extracting functions into own modules; count() extracted