[refactor] Just `toString()` an internal function instead of building a function from strings

This allows the code that we use inside the iframe to be minified when this library
is minified. In addition to that, it's easier to read and maintain from a development
point of view.