Updated error handling to use Error class

Minor change - I'm using sprintf.js in a system with JavaScript promises, and throwing Errors so the stack trace is visible (see also: http://stackoverflow.com/q/9183159/40352)

sprintf.js is great, thanks for making it!