Improve `String.prototype.endsWith` polyfill

This patch replaces the old `String.prototype.endsWith` polyfill with http://mths.be/endswith, while also adding the tests from that project.
Improve `String.prototype.contains` polyfill

This patch replaces the old `String.prototype.contains` polyfill with http://mths.be/contains, while also adding the tests from that project.
Move String polyfills to its own file