allow user to omit the error callback. fixed some accidental globals

not sure why github is showing such a huge diff.  maybe you were using tabs and i am using spaces? anyway, my webstorm ide shows a much more readable diff.