Added capitalize and title functions for strings

Style nit, but let's put the loop variable definition in the for loop unless we need to access it outside the loop.  We can also do that for len if we don't want to call s.size() every time.