Added support for AMD.
I've manually tested this feature with RequireJS and Dojo Toolkit, and everything worked as expected.
I'd be glad if you help me to test this!
expose string.js as AMD
Intentionally left window.S as a global function because third party application may have a global function called window.define and do not make use of any AMD loader.
do not define global object if a true amd loader is already defined
Merging code locally. Will be updated shortly.