Refactored background.js
Some refactorings
some codes were replaced with some in background.js which do the same job
Gived up using global array ItemsData
Each function will always allocate an array instead of ItemsData