Cleaned up clip_string and string_width

Both functions are very similar. They now have the same bugs fixed.