Remove unnecessary bits and make String#startsWith and String#endsWith conform to spec