restructured and added initialize and add methods
added refactored delete method but only works with a promise
made functions work without promises
made everything compatible with angularJS and added tests as an example