Update stringformat.js

Made it simpler: instead of having a function that constructs the function it will automatically export itself.