json_encode() is faster than serialize()

ref: http://stackoverflow.com/a/7723730/2566213
calculate only once in loops
Merge pull request #52 from rindeal/feature/speed-optimizations

Just some speed optimizations
Removed FetchCommand since it's not needed anymore
Fixed index of packages
Added index count
Merge branch 'develop' into feature/gpm