options object rather than arguments, added spinner support, cleaned up var declarations, removed superfluous dependencies