Convert constants.js to pure functions
Convert constants.js to pure functions

This commit enforces eslint's no-param-reassign rule by ensuring all
Array.reduce and switch logic operates on copies of parameters.

geoffreyyip/mta-dashboard,geoffreyyip/mta-dashboard