Nodified the sprintf.js implementation.
Changes as directed by jshint - did not tackle == and != hints
Minor changes to make this into a module.