Added an endswith to string

This makes us cross browser