JavaScript factory for using Toastr