refactored add and delete fully into functions.js

moved addItem and deleteItem fully into functions.js now events.js is
only calling these functions