Refactor of allocations data code out allocations_pie.js

Fixed JSHint issues.
Rebase to master.

Change-Id: I0fd77605a0976eeed030b72e18e0308377637782
Merge "Refactor of allocations data code out allocations_pie.js"